Issue Bug Closed

#83390ReflectionServiceTest fails due to ReflectionService being a singleton

Andreas Kienast 12/19/17, 19:07 updated 10/02/18, 10:53

Description

On my system, running all unit tests is not possible. The following tests fail for no recognizable reason on first sight:

1) TYPO3\CMS\Extbase\Tests\Unit\Reflection\ReflectionServiceTest::getClassTagsValues
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    'see' => Array (...)
-    'link' => Array (...)
+    'firsttest' => Array (...)
+    'anothertest' => Array (...)
 )

typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php:54
vendor/phpunit/phpunit/phpunit:53

2) TYPO3\CMS\Extbase\Tests\Unit\Reflection\ReflectionServiceTest::getClassTagValues
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'test for reflection'
 )

typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php:71
vendor/phpunit/phpunit/phpunit:53

3) TYPO3\CMS\Extbase\Tests\Unit\Reflection\ReflectionServiceTest::testIsClassTaggedWith
Failed asserting that false is true.

typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php:197
vendor/phpunit/phpunit/phpunit:53

It can be nailed down to ReflectionService being a singleton class which is not cleared up properly again.

Reviews 1