special handling for the JsonDescriptor to work around changes in PHP's JSON pretty printer

This commit is contained in:
Christian Flothmann 2014-06-20 14:58:30 +02:00
parent f2bdc22b0d
commit f4a3c7a370

View File

@ -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)