Yaffs site version 1.1
[yaffs-website] / vendor / symfony / console / Tests / Output / ConsoleOutputTest.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\Output;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Console\Formatter\OutputFormatter;
16 use Symfony\Component\Console\Output\ConsoleOutput;
17 use Symfony\Component\Console\Output\Output;
18
19 class ConsoleOutputTest extends TestCase
20 {
21     public function testConstructor()
22     {
23         $output = new ConsoleOutput(Output::VERBOSITY_QUIET, true);
24         $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument');
25         $this->assertSame($output->getFormatter(), $output->getErrorOutput()->getFormatter(), '__construct() takes a formatter or null as the third argument');
26     }
27
28     public function testSetFormatter()
29     {
30         $output = new ConsoleOutput();
31         $outputFormatter = new OutputFormatter();
32         $output->setFormatter($outputFormatter);
33         $this->assertSame($outputFormatter, $output->getFormatter());
34     }
35
36     public function testSetVerbosity()
37     {
38         $output = new ConsoleOutput();
39         $output->setVerbosity(Output::VERBOSITY_VERBOSE);
40         $this->assertSame(Output::VERBOSITY_VERBOSE, $output->getVerbosity());
41     }
42 }