In this test the reflection classes have not been mocked correctly. Though the current unit tests to not have any issues with it, the mocks should use the correct reflection classes, as otherwise updating variables via reflection will not work. See #44.
When adding the following debug code, one can see what is actually going wrong:
Obviously, get_class($object) and $refl->getName() should always be identitcal, but in testHydrateOneToManyAssociationByReferenceUsingIdentifiersArrayForRelations they aren't:
This PR fixes the test case to ensure that ClassMetadata is mocked correctly. Actually, in other test cases this is already implemented correctly, see for example in testHydrateOneToManyAssociationByReferenceWithArrayCausingDataModifications:
In this test the reflection classes have not been mocked correctly. Though the current unit tests to not have any issues with it, the mocks should use the correct reflection classes, as otherwise updating variables via reflection will not work. See #44.
When adding the following debug code, one can see what is actually going wrong:
Obviously,
get_class($object)
and$refl->getName()
should always be identitcal, but intestHydrateOneToManyAssociationByReferenceUsingIdentifiersArrayForRelations
they aren't:This PR fixes the test case to ensure that
ClassMetadata
is mocked correctly. Actually, in other test cases this is already implemented correctly, see for example intestHydrateOneToManyAssociationByReferenceWithArrayCausingDataModifications
:https://github.com/doctrine/doctrine-laminas-hydrator/blob/94e6cadcaa04166777a52eac577827f318a12ffa/tests/DoctrineObjectTest.php#L2242-L2281
This is simply transferred to
testHydrateOneToManyAssociationByReferenceUsingIdentifiersArrayForRelations
.