Project

General

Profile

Actions

Bug #22732

closed

Unit test failures in t3lib_matchCondition_backend_testcase

Added by Oliver Klee over 14 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-05-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

14500_trunk.diff (702 Bytes) 14500_trunk.diff Administrator Admin, 2010-12-17 16:04
14500_44.diff (702 Bytes) 14500_44.diff Administrator Admin, 2010-12-17 16:04
14500_43.diff (717 Bytes) 14500_43.diff Administrator Admin, 2010-12-17 16:04
14500_trunk_and_44_v2.diff (1006 Bytes) 14500_trunk_and_44_v2.diff Administrator Admin, 2010-12-17 16:15
14500_43_v2.diff (1021 Bytes) 14500_43_v2.diff Administrator Admin, 2010-12-17 16:15
Actions #1

Updated by Christian Kuhn over 14 years ago

The matchCondition_backend tests run fine for me with trunk rev. 7809.

Actions #2

Updated by Felix Oertel over 14 years ago

same tests fail for me in trunk rev. 7826 (on php 5.3)

Actions #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.

Actions #4

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.

Actions #5

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. :-)

Actions #6

Updated by Steffen Kamper almost 14 years ago

Committed to trunk rev 9832

Actions #7

Updated by Susanne Moog over 13 years ago

  • Target version deleted (4.5.0)
Actions

Also available in: Atom PDF