From 3a520f2813d84cfc67ea9a669eaa7380caf8417e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 19 Sep 2019 19:42:00 +0200 Subject: [PATCH] [PhpUnitBridge] more fixes for PHP 5.5 --- .../Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php | 2 +- .../PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php index 44f3512c4d..7691a2a13d 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php @@ -249,7 +249,7 @@ class Deprecation foreach (get_declared_classes() as $class) { if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) { $r = new \ReflectionClass($class); - $v = \dirname($r->getFileName(), 2); + $v = \dirname(\dirname($r->getFileName())); if (file_exists($v.'/composer/installed.json')) { self::$vendors[] = $v; $loader = require $v.'/autoload.php'; diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php index 7ff480fec3..d59b2d9337 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php @@ -29,7 +29,7 @@ class DeprecationTest extends TestCase { $r = new \ReflectionClass(Deprecation::class); - if (dirname($r->getFileName(), 2) !== dirname(__DIR__, 2)) { + if (\dirname(\dirname($r->getFileName())) !== \dirname(\dirname(__DIR__))) { $this->markTestSkipped('Test case is not compatible with having the bridge in vendor/'); }