From f4a3c7a370fe1f05acb9c643301a84909b18ecd8 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 20 Jun 2014 14:58:30 +0200 Subject: [PATCH] special handling for the JsonDescriptor to work around changes in PHP's JSON pretty printer --- .../Tests/Console/Descriptor/AbstractDescriptorTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php index a8e64e3797..b78ac7f046 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php @@ -95,7 +95,12 @@ abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase $options['raw_output'] = true; $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true); $this->getDescriptor()->describe($output, $describedObject, $options); - $this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $output->fetch()))); + + if ('json' === $this->getFormat()) { + $this->assertEquals(json_decode($expectedDescription), json_decode($output->fetch())); + } else { + $this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $output->fetch()))); + } } private function getDescriptionTestData(array $objects)