Bug #42269

Unittests fail with PHPunit 3.7(.8)

Added by Christian Jul Jensen over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Category:
- Testing -
Start date:
2012-10-22
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

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 installed through composerResolvedKarsten Dambekalns2012-10-18

Actions
#1

Updated by Christian Jul Jensen over 8 years ago

  • Assignee 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 over 8 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 over 8 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 8 years ago

  • Status changed from Under Review to Closed

Change has been abandoned.

Also available in: Atom PDF