From bca4761f372724fe631f5018dd18db0e0a23eb11 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 26 Jun 2019 13:29:01 +0200 Subject: [PATCH] [PhpUnitBridge] Fix tests --- .../DeprecationTest.php | 6 +++++ .../DeprecationErrorHandler/disabled.phpt | 4 ++-- .../disabled_from_env_superglobal.phpt | 24 ------------------- .../disabled_from_putenv.phpt | 24 ------------------- 4 files changed, 8 insertions(+), 50 deletions(-) delete mode 100644 src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled_from_env_superglobal.phpt delete mode 100644 src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled_from_putenv.phpt diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php index 583cca22f4..0c8708bb35 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php @@ -26,6 +26,12 @@ class DeprecationTest extends TestCase public function testItCanTellWhetherItIsInternal() { + $r = new \ReflectionClass(Deprecation::class); + + if (dirname($r->getFileName(), 2) !== dirname(__DIR__, 2)) { + $this->markTestSkipped('Test case is not compatible with having the bridge in vendor/'); + } + $deprecation = new Deprecation('💩', $this->debugBacktrace(), __FILE__); $this->assertSame(Deprecation::TYPE_SELF, $deprecation->getType()); } diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt index a55e88d1a8..0115bbd242 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt @@ -1,9 +1,9 @@ --TEST-- -Test DeprecationErrorHandler in disabled mode +Test DeprecationErrorHandler in weak mode --FILE-- ---EXPECTF-- -00 diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled_from_putenv.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled_from_putenv.phpt deleted file mode 100644 index 73a67241a4..0000000000 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled_from_putenv.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test DeprecationErrorHandler in disabled mode (via putenv) ---FILE-- - ---EXPECTF-- -00