Skip to content

Commit f4a3c7a

Browse files
committed
special handling for the JsonDescriptor to work around changes in PHP's JSON pretty printer
1 parent f2bdc22 commit f4a3c7a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ private function assertDescription($expectedDescription, $describedObject, array
9595
$options['raw_output'] = true;
9696
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
9797
$this->getDescriptor()->describe($output, $describedObject, $options);
98-
$this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $output->fetch())));
98+
99+
if ('json' === $this->getFormat()) {
100+
$this->assertEquals(json_decode($expectedDescription), json_decode($output->fetch()));
101+
} else {
102+
$this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $output->fetch())));
103+
}
99104
}
100105

101106
private function getDescriptionTestData(array $objects)

0 commit comments

Comments
 (0)