Tests not passing if run on PHP 7.4 or Windows #2

Closed
opened 2026-01-24 11:24:42 +01:00 by admin · 0 comments
Owner

Originally created by @sspat on GitHub (Dec 2, 2019).

Originally assigned to: @sspat on GitHub.

Currently the following errors are happening if trying to run the tests in PHP 7.4.
Also some tests are failing if run on Windows.

This is the PHPUnit output:

$ vendor/bin/phpunit
PHPUnit 7.3.5 by Sebastian Bergmann and contributors.

F.FF........E.............................................E.EE.  63 / 124 ( 50%)
...............................................EEE...........   124 / 124 (100%)

Time: 145 ms, Memory: 6.00MB

There were 7 errors:

1) Doctrine\Tests\Common\Reflection\StaticReflectionClassTest::testGetMethod
Declaration of Doctrine\Common\Reflection\StaticReflectionMethod::getClosure($object) should be compatible with ReflectionMethod::getClosure($object = NULL)

C:\work\projects\oss\doctrine-reflection\lib\Doctrine\Common\Reflection\StaticReflectionMethod.php:92
C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionClassTest.php:59

2) Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest::testGetDeclaringClass
Function ReflectionType::__toString() is deprecated

C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest.php:30

3) Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest::testGetDocComment
Function ReflectionType::__toString() is deprecated

C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest.php:50

4) Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest::testGetUseStatements
Function ReflectionType::__toString() is deprecated

C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest.php:62

5) Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest::testGetDeclaringClass
Function ReflectionType::__toString() is deprecated

C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest.php:30

6) Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest::testGetDocComment
Function ReflectionType::__toString() is deprecated

C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest.php:41

7) Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest::testGetUseStatements
Function ReflectionType::__toString() is deprecated

C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest.php:53

--

There were 3 failures:

1) Doctrine\Tests\Common\Reflection\Psr0FindFileTest::testFindFile
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection/NoParent.php'
+'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\NoParent.php'

C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\Psr0FindFileTest.php:20

2) Doctrine\Tests\Common\Reflection\Psr0FindFileTest::testFindFileWithLeadingNamespaceSeparator
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection/NoParent.php'
+'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\NoParent.php'

C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\Psr0FindFileTest.php:32

3) Doctrine\Tests\Common\Reflection\Psr0FindFileTest::testFindFileFromPearLikeClassName
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection/NoParent.php'
+'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\NoParent.php'

C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\Psr0FindFileTest.php:39

ERRORS!
Tests: 124, Assertions: 218, Errors: 7, Failures: 3.

Originally created by @sspat on GitHub (Dec 2, 2019). Originally assigned to: @sspat on GitHub. Currently the following errors are happening if trying to run the tests in PHP 7.4. Also some tests are failing if run on Windows. This is the PHPUnit output: ```bash $ vendor/bin/phpunit PHPUnit 7.3.5 by Sebastian Bergmann and contributors. F.FF........E.............................................E.EE. 63 / 124 ( 50%) ...............................................EEE........... 124 / 124 (100%) Time: 145 ms, Memory: 6.00MB There were 7 errors: 1) Doctrine\Tests\Common\Reflection\StaticReflectionClassTest::testGetMethod Declaration of Doctrine\Common\Reflection\StaticReflectionMethod::getClosure($object) should be compatible with ReflectionMethod::getClosure($object = NULL) C:\work\projects\oss\doctrine-reflection\lib\Doctrine\Common\Reflection\StaticReflectionMethod.php:92 C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionClassTest.php:59 2) Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest::testGetDeclaringClass Function ReflectionType::__toString() is deprecated C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest.php:30 3) Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest::testGetDocComment Function ReflectionType::__toString() is deprecated C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest.php:50 4) Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest::testGetUseStatements Function ReflectionType::__toString() is deprecated C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionMethodTest.php:62 5) Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest::testGetDeclaringClass Function ReflectionType::__toString() is deprecated C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest.php:30 6) Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest::testGetDocComment Function ReflectionType::__toString() is deprecated C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest.php:41 7) Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest::testGetUseStatements Function ReflectionType::__toString() is deprecated C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\StaticReflectionPropertyTest.php:53 -- There were 3 failures: 1) Doctrine\Tests\Common\Reflection\Psr0FindFileTest::testFindFile Failed asserting that two strings are identical. --- Expected +++ Actual @@ @@ -'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection/NoParent.php' +'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\NoParent.php' C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\Psr0FindFileTest.php:20 2) Doctrine\Tests\Common\Reflection\Psr0FindFileTest::testFindFileWithLeadingNamespaceSeparator Failed asserting that two strings are identical. --- Expected +++ Actual @@ @@ -'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection/NoParent.php' +'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\NoParent.php' C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\Psr0FindFileTest.php:32 3) Doctrine\Tests\Common\Reflection\Psr0FindFileTest::testFindFileFromPearLikeClassName Failed asserting that two strings are identical. --- Expected +++ Actual @@ @@ -'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection/NoParent.php' +'C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\NoParent.php' C:\work\projects\oss\doctrine-reflection\tests\Doctrine\Tests\Common\Reflection\Psr0FindFileTest.php:39 ERRORS! Tests: 124, Assertions: 218, Errors: 7, Failures: 3. ```
admin added the Enhancement label 2026-01-24 11:24:42 +01:00
admin closed this issue 2026-01-24 11:24:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/reflection#2