Unittests fail with PHPunit 3.7(.8)
There was 1 failure:
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.
+ '__phpunit_id' => null
Updated by Christian Jul Jensen almost 9 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