From 31f3b4dbcc1e456a6b8d8bcc364f540d287c3c8e Mon Sep 17 00:00:00 2001 From: ShinDarth Date: Tue, 6 Dec 2016 16:01:27 +0100 Subject: [PATCH 1/3] [VarDumper] fix tests when xdebug is enabled --- .../Component/VarDumper/Tests/Caster/ReflectionCasterTest.php | 4 ++++ src/Symfony/Component/VarDumper/Tests/VarClonerTest.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php b/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php index f4cc50efc597c..fc5cee379f59f 100644 --- a/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php @@ -147,6 +147,10 @@ class: "Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest" */ public function testGenerator() { + if (extension_loaded('xdebug')) { + $this->markTestSkipped('xdebug is active'); + } + $g = new GeneratorDemo(); $g = $g->baz(); $r = new \ReflectionGenerator($g); diff --git a/src/Symfony/Component/VarDumper/Tests/VarClonerTest.php b/src/Symfony/Component/VarDumper/Tests/VarClonerTest.php index eb2d0b0eda65c..b17c414789af6 100644 --- a/src/Symfony/Component/VarDumper/Tests/VarClonerTest.php +++ b/src/Symfony/Component/VarDumper/Tests/VarClonerTest.php @@ -157,6 +157,10 @@ public function testClone() public function testJsonCast() { + if (extension_loaded('xdebug')) { + $this->markTestSkipped('xdebug is active'); + } + $data = (array) json_decode('{"1":{}}'); $cloner = new VarCloner(); From d7f0f44a24091534e6daea062471d6bb359c6a41 Mon Sep 17 00:00:00 2001 From: ShinDarth Date: Tue, 6 Dec 2016 16:34:07 +0100 Subject: [PATCH 2/3] Improvement of previous commit --- .../Component/VarDumper/Tests/Caster/ReflectionCasterTest.php | 2 +- src/Symfony/Component/VarDumper/Tests/VarClonerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php b/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php index fc5cee379f59f..3c1b9598ed768 100644 --- a/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php @@ -147,7 +147,7 @@ class: "Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest" */ public function testGenerator() { - if (extension_loaded('xdebug')) { + if (ini_get('xdebug.overload_var_dump') == 2) { $this->markTestSkipped('xdebug is active'); } diff --git a/src/Symfony/Component/VarDumper/Tests/VarClonerTest.php b/src/Symfony/Component/VarDumper/Tests/VarClonerTest.php index b17c414789af6..89634173670f2 100644 --- a/src/Symfony/Component/VarDumper/Tests/VarClonerTest.php +++ b/src/Symfony/Component/VarDumper/Tests/VarClonerTest.php @@ -157,7 +157,7 @@ public function testClone() public function testJsonCast() { - if (extension_loaded('xdebug')) { + if (ini_get('xdebug.overload_var_dump') == 2) { $this->markTestSkipped('xdebug is active'); } From 0839af195382fb681194475c051c0236f30f5b94 Mon Sep 17 00:00:00 2001 From: ShinDarth Date: Tue, 6 Dec 2016 16:43:58 +0100 Subject: [PATCH 3/3] Partially reverted previous commit --- .../Component/VarDumper/Tests/Caster/ReflectionCasterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php b/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php index 3c1b9598ed768..fc5cee379f59f 100644 --- a/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php @@ -147,7 +147,7 @@ class: "Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest" */ public function testGenerator() { - if (ini_get('xdebug.overload_var_dump') == 2) { + if (extension_loaded('xdebug')) { $this->markTestSkipped('xdebug is active'); }