sebastianbergmann / recursion-context

Provides functionality to recursively process PHP variables
BSD 3-Clause "New" or "Revised" License
6.52k stars 18 forks source link

Version 1.0.4 breaks object-enumerator tests #7

Closed sebastianbergmann closed 7 years ago

sebastianbergmann commented 7 years ago

Version 1.0.2

PHPUnit 5.6.3 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.1.0RC6 with Xdebug 2.5.0rc1
Configuration: /usr/local/src/object-enumerator/phpunit.xml
Warning:       Deprecated configuration setting "checkForUnintentionallyCoveredCode" used

.........                                                           9 / 9 (100%)

Time: 30 ms, Memory: 4.00MB

OK (9 tests, 20 assertions)

Version 1.0.4

PHPUnit 5.6.3 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.1.0RC6 with Xdebug 2.5.0rc1
Configuration: /usr/local/src/object-enumerator/phpunit.xml
Warning:       Deprecated configuration setting "checkForUnintentionallyCoveredCode" used

.FFF.FF..                                                           9 / 9 (100%)

Time: 25 ms, Memory: 4.00MB

There were 5 failures:

1) SebastianBergmann\ObjectEnumerator\EnumeratorTest::testEnumeratesArrayWithSingleObject
Failed asserting that actual size 2 matches expected size 1.

/usr/local/src/object-enumerator/tests/EnumeratorTest.php:44

2) SebastianBergmann\ObjectEnumerator\EnumeratorTest::testEnumeratesArrayWithTwoReferencesToTheSameObject
Failed asserting that actual size 2 matches expected size 1.

/usr/local/src/object-enumerator/tests/EnumeratorTest.php:54

3) SebastianBergmann\ObjectEnumerator\EnumeratorTest::testEnumeratesArrayOfObjects
Failed asserting that actual size 3 matches expected size 2.

/usr/local/src/object-enumerator/tests/EnumeratorTest.php:65

4) SebastianBergmann\ObjectEnumerator\EnumeratorTest::testEnumeratesObjectWithAggregatedObjectsInArray
Failed asserting that actual size 3 matches expected size 2.

/usr/local/src/object-enumerator/tests/EnumeratorTest.php:94

5) SebastianBergmann\ObjectEnumerator\EnumeratorTest::testEnumeratesObjectsWithCyclicReferences
Failed asserting that actual size 3 matches expected size 2.

/usr/local/src/object-enumerator/tests/EnumeratorTest.php:109

FAILURES!
Tests: 9, Assertions: 12, Failures: 5.
sebastianbergmann commented 7 years ago

@bwoebi Can you have a look, please?

bwoebi commented 7 years ago

@sebastianbergmann I'll give it a look the afternoon.

sebastianbergmann commented 7 years ago

Thanks! @bwoebi

bwoebi commented 7 years ago

@sebastianbergmann Yeah, RecursionContext variables must not be accessed while RecursionContext is still in use. Needs a copy of the array before accessing it if added.

Added a PR over there.