Bug #22732
closedUnit test failures in t3lib_matchCondition_backend_testcase
0%
Description
Testsuite: t3lib_matchCondition_backend_testcase
pageIdCanBeDeterminedWhileEditingARegularRecord
! Failure in test case pageIdCanBeDeterminedWhileEditingARegularRecord
File: /home/klee/eclipse/typo3_src/tests/t3lib/matchcondition/t3lib_matchcondition_backend_testcase.php
Line: 755:
Description
Failed asserting that <null> is equal to <integer:999>.
pageIdCanBeDeterminedWhileCreatingARecordAfterAnExistingRecord
! Failure in test case pageIdCanBeDeterminedWhileCreatingARecordAfterAnExistingRecord
File: /home/klee/eclipse/typo3_src/tests/t3lib/matchcondition/t3lib_matchcondition_backend_testcase.php
Line: 779:
Description
Failed asserting that <null> is equal to <integer:999>.
pageIdCanBeDeterminedWhileCopyingARecordAfterAnExistingRecord
! Failure in test case pageIdCanBeDeterminedWhileCopyingARecordAfterAnExistingRecord
File: /home/klee/eclipse/typo3_src/tests/t3lib/matchcondition/t3lib_matchcondition_backend_testcase.php
Line: 814:
Description
Failed asserting that <null> is equal to <integer:999>.
(issue imported from #M14500)
Files
Updated by Christian Kuhn over 14 years ago
The matchCondition_backend tests run fine for me with trunk rev. 7809.
Updated by Felix Oertel over 14 years ago
same tests fail for me in trunk rev. 7826 (on php 5.3)
Updated by Christian Kuhn over 14 years ago
Confirmed.
This happens with php 5.3 (5.3.2 in my case) only. Furhtermore the tests run fine for me if executed by cli, but not if executed through TYPO3 backend.
I tried to track this down and came to the conclusion that this is probably not a problem in TYPO3 core, but an issue with phpunit (it happens with phpunit 5.4.15, too), or with phpunit extension.
phpunit doesn't call the second callback method "determinePageIdByRecordDatabaseFetchCallback" defined for TYPO3_DB->sql_fetch_assoc, defined in tests/t3lib/matchcondition/t3lib_matchcondition_backendTest.php, method setUpDatabaseMockForDeterminePageId(). This works fine with php 5.2 but fails with php 5.3.
The mocked $GLOBALS['TYPO3_DB']->sql_fetch_assoc() is called by t3lib/class.t3lib_befunc.php in method getRecord() in line 236, and returns false with php 5.3 (and the callback method is not executed), while with php 5.2 array('pid' => 999) is returned (and the callback method is executed).
@Oliver: Would you like to dig further? This issue overextends my current knowledge of phpunit internals at this point.
Updated by Steffen Kamper about 14 years ago
i came to the same conclusion -> fail on php5.3.0 windows.
determinePageIdByRecordDatabaseFetchCallback is never called, also debugged until getRecord(), $res is ok but the mocked function isn't called.
Debugging TYPO3_DB shows that the callback is in.
Updated by Oliver Klee almost 14 years ago
I've tested some more. Only the determinePageIdByRecordDatabaseExecuteCallback gets called, while the determinePageIdByRecordDatabaseFetchCallback does not get called.
I don't fully understand this, but by some poking and testing, I've been able to fix this. :-)