Skip to content

Commit 4f9e449

Browse files
committed
Merge branch '3.1' into 3.2
* 3.1: [TwigBundle] fixed usage when Templating is not installed [Validator] Check cascasdedGroups for being countable [Cache] Add changelog [Filesystem] Check that the directory is writable after created it in dumpFile() [HttpFoundation] Improved set cookie header tests [Serializer] int is valid when float is expected when deserializing JSON [Console] increased code coverage of Output classes Added missing headers in fixture files [Profiler][VarDumper] Fix minor color issue & duplicated selector
2 parents a41b79e + 047f164 commit 4f9e449

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

Tests/Output/ConsoleOutputTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Console\Tests\Output;
1313

14+
use Symfony\Component\Console\Formatter\OutputFormatter;
1415
use Symfony\Component\Console\Output\ConsoleOutput;
1516
use Symfony\Component\Console\Output\Output;
1617

@@ -22,4 +23,19 @@ public function testConstructor()
2223
$this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument');
2324
$this->assertSame($output->getFormatter(), $output->getErrorOutput()->getFormatter(), '__construct() takes a formatter or null as the third argument');
2425
}
26+
27+
public function testSetFormatter()
28+
{
29+
$output = new ConsoleOutput();
30+
$outputFormatter = new OutputFormatter();
31+
$output->setFormatter($outputFormatter);
32+
$this->assertSame($outputFormatter, $output->getFormatter());
33+
}
34+
35+
public function testSetVerbosity()
36+
{
37+
$output = new ConsoleOutput();
38+
$output->setVerbosity(Output::VERBOSITY_VERBOSE);
39+
$this->assertSame(Output::VERBOSITY_VERBOSE, $output->getVerbosity());
40+
}
2541
}

Tests/Output/NullOutputTest.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
namespace Symfony\Component\Console\Tests\Output;
1313

14+
use Symfony\Component\Console\Formatter\OutputFormatter;
1415
use Symfony\Component\Console\Output\NullOutput;
16+
use Symfony\Component\Console\Output\Output;
1517
use Symfony\Component\Console\Output\OutputInterface;
1618

1719
class NullOutputTest extends \PHPUnit_Framework_TestCase
@@ -36,4 +38,50 @@ public function testVerbosity()
3638
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
3739
$this->assertSame(OutputInterface::VERBOSITY_QUIET, $output->getVerbosity(), '->getVerbosity() always returns VERBOSITY_QUIET for NullOutput');
3840
}
41+
42+
public function testSetFormatter()
43+
{
44+
$output = new NullOutput();
45+
$outputFormatter = new OutputFormatter();
46+
$output->setFormatter($outputFormatter);
47+
$this->assertNotSame($outputFormatter, $output->getFormatter());
48+
}
49+
50+
public function testSetVerbosity()
51+
{
52+
$output = new NullOutput();
53+
$output->setVerbosity(Output::VERBOSITY_NORMAL);
54+
$this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity());
55+
}
56+
57+
public function testSetDecorated()
58+
{
59+
$output = new NullOutput();
60+
$output->setDecorated(true);
61+
$this->assertFalse($output->isDecorated());
62+
}
63+
64+
public function testIsQuiet()
65+
{
66+
$output = new NullOutput();
67+
$this->assertTrue($output->isQuiet());
68+
}
69+
70+
public function testIsVerbose()
71+
{
72+
$output = new NullOutput();
73+
$this->assertFalse($output->isVerbose());
74+
}
75+
76+
public function testIsVeryVerbose()
77+
{
78+
$output = new NullOutput();
79+
$this->assertFalse($output->isVeryVerbose());
80+
}
81+
82+
public function testIsDebug()
83+
{
84+
$output = new NullOutput();
85+
$this->assertFalse($output->isDebug());
86+
}
3987
}

0 commit comments

Comments
 (0)