ZF-2629: Unittests problem with Session namespace
Description
Problem running Unittests for Zend_Session:
C:\Voxtronic\3rdParty\Zend Framework\tests>phpunit --verbose Zend_Session_AllTests
PHPUnit 3.2.7 by Sebastian Bergmann.
Zend Framework - Zend_Session
Zend_SessionTest
.......................FFFFIF
Time: 02:25
There were 5 failures:
1) testSetExpirationSeconds(Zend_SessionTest)
iteration over default Zend_Session namespace failed; expecting result === ';a =
== apple;o === orange;p === pear', but got ''
Failed asserting that is true.
C:\Voxtronic\3rdParty\Zend Framework\tests\Zend\Session\SessionTest.php:764
2) testSetExpireSessionHops(Zend_SessionTest)
iteration over default Zend_Session namespace failed (result=''; hop #1)
Failed asserting that is true.
C:\Voxtronic\3rdParty\Zend Framework\tests\Zend\Session\SessionTest.php:815
3) testSetExpireSessionVarsByHops1(Zend_SessionTest)
iteration over named Zend_Session namespace failed (result=''; hop #1)
Failed asserting that is true.
C:\Voxtronic\3rdParty\Zend Framework\tests\Zend\Session\SessionTest.php:866
C:\Voxtronic\3rdParty\Zend Framework\tests\Zend\Session\SessionTest.php:828
4) testSetExpireSessionVarsByHops2(Zend_SessionTest)
iteration over named Zend_Session namespace failed (result=''; hop #1)
Failed asserting that is true.
C:\Voxtronic\3rdParty\Zend Framework\tests\Zend\Session\SessionTest.php:866
C:\Voxtronic\3rdParty\Zend Framework\tests\Zend\Session\SessionTest.php:838
5) testSetExpireSessionVarsByHopsOnUse(Zend_SessionTest)
unexpected results iterating over named Zend_Session namespace (result=''; expec
ted ';g === guava;p === plum'; hop #1)
Failed asserting that is true.
C:\Voxtronic\3rdParty\Zend Framework\tests\Zend\Session\SessionTest.php:928
--
There was 1 incomplete test:
1) testArrays(Zend_SessionTest)
C:\Voxtronic\3rdParty\Zend Framework\tests\Zend\Session\SessionTest.php:879
FAILURES!
Tests: 29, Failures: 5, Incomplete: 1.
Testbed: WindowsXP, PHP 5.2.5, Standard installation
Comments
Posted by Ralph Schindler (ralph) on 2008-02-14T11:03:24.000+0000
Thomas,
Are you still getting this issue? I just ran the tests and they did indeed run fine.. do you think this can be a windows issue?
Posted by Thomas Weidner (thomas) on 2008-02-14T14:24:35.000+0000
I just tested with the latest release 8008 and the errors are still there. So it must be eighter a php-version or an OS problem.
Posted by Ralph Schindler (ralph) on 2008-02-20T14:32:52.000+0000
Thomas,
I am passing this to darby to look at b/c I simply cannot duplicate.
I installed php 5.2.5, phpunit and pulled down r8216.
Changed no ini files, my setup is running stock.. this is what i get still:
I am not sure how to proceed since I cannot duplicate.
Darby claims to be able to get the same exact results as you though, so.. Darby, any ideas?
-ralph
Posted by Ralph Schindler (ralph) on 2008-02-20T14:34:08.000+0000
I cannot reproduce, any ideas?
-ralph
Posted by Darby Felton (darby) on 2008-02-20T15:24:02.000+0000
I can reproduce the results problem exactly with PHP 5.1.4 on WinXP, though I'm unsure exactly what's happening at this point. A cursory look gives me some hints:
Posted by Ralph Schindler (ralph) on 2008-02-21T08:44:39.000+0000
The only thing I am noticing is that all tests after testUnsetAllNamespace() make use of exec() to complete their tests.
Is it possible your setup is disallowing exec() or, perhaps php is not in the include path?
Perhaps if someone could see if the test is failing around line 759 of SessionTest.php
-ralph
Posted by Darby Felton (darby) on 2008-03-03T14:06:00.000+0000
I also got the following error from running "{{phpunit --verbose AllTests}}" on r8521 of the trunk:
Posted by Wil Sinclair (wil) on 2008-03-21T17:05:32.000+0000
This issue should have been fixed for the 1.5 release.
Posted by Darby Felton (darby) on 2008-04-08T12:57:57.000+0000
Fixed with SVN r9178 and r9179.
Posted by Alexander Veremyev (alexander) on 2008-07-08T09:30:37.000+0000
The problem still exists
Posted by Alexander Veremyev (alexander) on 2008-07-09T03:54:30.000+0000
The output I get now on Linux system:
{panel} PHPUnit 3.2.19 by Sebastian Bergmann.
.......................FFFFIF
Time: 23 seconds
There were 5 failures:
1) testSetExpirationSeconds(Zend_SessionTest) iteration over default Zend_Session namespace failed; expecting result === ';a === apple;o === orange;p === pear', but got '' Failed asserting that is true. iteration over default Zend_Session namespace failed; expecting result === ';a === apple;o === orange;p === pear', but got '' Failed asserting that is true.
2) testSetExpireSessionHops(Zend_SessionTest) iteration over default Zend_Session namespace failed (result=''; hop #1) Failed asserting that is true. iteration over default Zend_Session namespace failed (result=''; hop #1) Failed asserting that is true.
3) testSetExpireSessionVarsByHops1(Zend_SessionTest) iteration over named Zend_Session namespace failed (result=''; hop #1) Failed asserting that is true. iteration over named Zend_Session namespace failed (result=''; hop #1) Failed asserting that is true.
4) testSetExpireSessionVarsByHops2(Zend_SessionTest) iteration over named Zend_Session namespace failed (result=''; hop #1) Failed asserting that is true. iteration over named Zend_Session namespace failed (result=''; hop #1) Failed asserting that is true.
5) testSetExpireSessionVarsByHopsOnUse(Zend_SessionTest) unexpected results iterating over named Zend_Session namespace (result=''; expected ';g === guava;p === plum'; hop #1) Failed asserting that is true. unexpected results iterating over named Zend_Session namespace (result=''; expected ';g === guava;p === plum'; hop #1) Failed asserting that is true.
FAILURES! Tests: 29, Failures: 5, Incomplete: 1. {panel}
Posted by Alexander Veremyev (alexander) on 2008-07-10T01:55:35.000+0000
The problem was in the wrong assumptions about an 'exec()' execution time.
'SessionTestHelper.php' script includes 'tests/TestHelper.php' script with other heavy includes from PHPUnit package. It slows down 'SessionTestHelper.php' script execution time to 2 seconds in Linux environment and to ~35 seconds (!!!) in Windows environment.
Then, testSetExpirationSeconds() failure stops testSetExpirationSeconds() execution and leave session in the inconsistent state. That produced other four failures.
Posted by Alexander Veremyev (alexander) on 2008-07-26T10:23:08.000+0000
Changes also merged into release-1.5 branch.
Posted by Wil Sinclair (wil) on 2008-09-02T10:39:26.000+0000
Updating for the 1.6.0 release.