Yaffs site version 1.1
[yaffs-website] / vendor / symfony / console / Tests / Descriptor / JsonDescriptorTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Console\Tests\Descriptor;
13
14 use Symfony\Component\Console\Descriptor\JsonDescriptor;
15 use Symfony\Component\Console\Output\BufferedOutput;
16
17 class JsonDescriptorTest extends AbstractDescriptorTest
18 {
19     protected function getDescriptor()
20     {
21         return new JsonDescriptor();
22     }
23
24     protected function getFormat()
25     {
26         return 'json';
27     }
28
29     protected function assertDescription($expectedDescription, $describedObject)
30     {
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));
34     }
35 }