special handling for the JsonDescriptor to work around changes in PHP's JSON pretty printer
This commit is contained in:
parent
f2bdc22b0d
commit
f4a3c7a370
@ -95,7 +95,12 @@ abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
|
|||||||
$options['raw_output'] = true;
|
$options['raw_output'] = true;
|
||||||
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
|
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
|
||||||
$this->getDescriptor()->describe($output, $describedObject, $options);
|
$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)
|
private function getDescriptionTestData(array $objects)
|
||||||
|
Reference in New Issue
Block a user