4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Console\Tests\Descriptor;
14 use Symfony\Component\Console\Descriptor\JsonDescriptor;
15 use Symfony\Component\Console\Output\BufferedOutput;
17 class JsonDescriptorTest extends AbstractDescriptorTest
19 protected function getDescriptor()
21 return new JsonDescriptor();
24 protected function getFormat()
29 protected function assertDescription($expectedDescription, $describedObject)
31 $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
32 $this->getDescriptor()->describe($output, $describedObject, array('raw_output' => true));
33 $this->assertEquals(json_decode(trim($expectedDescription), true), json_decode(trim(str_replace(PHP_EOL, "\n", $output->fetch())), true));