Bug #42269

Unittests fail with PHPunit 3.7(.8)

Added by Christian Jul Jensen almost 3 years ago. Updated over 2 years ago.

Status:Closed Start date:2012-10-22
Priority:Should have Due date:
Assigned To:Christian Jul Jensen % Done:

0%

Category:- Testing -
Target version:TYPO3 Flow Base Distribution - 2.0 beta 1
PHP Version: Complexity:
Has patch:No Affected Flow version:Git 1.2 (master)

Description

Output:

There was 1 failure:

1) TYPO3\Flow\Tests\Unit\Persistence\Generic\DataMapperTest::mapToObjectReconstitutesExpectedObjectAndRegistersItWithIdentitymapToObjects
Expectation failed for method name is equal to <string:registerObject> when invoked 1 time(s)
Parameter 0 for invocation TYPO3\Flow\Persistence\Generic\Session::registerObject(Entity519192b8dbb06b57f5a377fec3fc274e Object (...), '1234') does not match expected value.
Failed asserting that two objects are equal.
--- Expected
++ Actual
@ @
Entity519192b8dbb06b57f5a377fec3fc274e Object (
- '__phpunit_id' => 'Entity519192b8dbb06b57f5a377f...274e#0'
'__phpunit_id' => null
)

/opt/local/apache2/htdocs/TYPO3-Flow/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Generic/DataMapper.php:107
/opt/local/apache2/htdocs/TYPO3-Flow/Packages/Framework/TYPO3.Flow/Tests/Unit/Persistence/Generic/DataMapperTest.php:84
/opt/local/apache2/htdocs/TYPO3-Flow/Packages/Framework/TYPO3.Flow/Tests/BaseTestCase.php:50


Related issues

related to TYPO3.Flow - Bug #42114: PHPUnit functional tests cannot be run when only installe... Resolved 2012-10-18

History

#1 Updated by Christian Jul Jensen almost 3 years ago

  • Assigned To set to Christian Jul Jensen

The issue here is that PHPUnit-Mock-Objects in has added an internal identifier '__phpunit_id' to mock objects, this property is not set correctly when reconstituting the objects in DataMapper::mapToObjetcs. The expect calls in mapToObjectReconstitutesExpectedObjectAndRegistersItWithIdentitymapToObjects thus fails because the objects are not identical.

There are bugs reported for PHPUnit Mock Objects which might solve this, namely https://github.com/sebastianbergmann/phpunit-mock-objects/issues/100, but most likely the test will have to be adjusted to test whether the reconstitution is correct, and not whether the objects are identical.

For now, we have decided to just skip the test for 3.7

#2 Updated by Gerrit Code Review almost 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15905

#3 Updated by Gerrit Code Review almost 3 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15905

#4 Updated by Karsten Dambekalns over 2 years ago

  • Status changed from Under Review to Closed

Change has been abandoned.

Also available in: Atom PDF