Merge branch '3.4' into 4.2
* 3.4: Make tests independent from each other
This commit is contained in:
commit
bbad6e8e58
@ -41,6 +41,13 @@ class ApplicationTest extends TestCase
|
||||
{
|
||||
protected static $fixturesPath;
|
||||
|
||||
private $colSize;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->colSize = getenv('COLUMNS');
|
||||
}
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$fixturesPath = realpath(__DIR__.'/Fixtures/');
|
||||
@ -384,6 +391,7 @@ class ApplicationTest extends TestCase
|
||||
*/
|
||||
public function testFindWithAmbiguousAbbreviations($abbreviation, $expectedExceptionMessage)
|
||||
{
|
||||
putenv('COLUMNS=120');
|
||||
if (method_exists($this, 'expectException')) {
|
||||
$this->expectException('Symfony\Component\Console\Exception\CommandNotFoundException');
|
||||
$this->expectExceptionMessage($expectedExceptionMessage);
|
||||
@ -515,6 +523,7 @@ class ApplicationTest extends TestCase
|
||||
|
||||
public function testFindAlternativeExceptionMessageMultiple()
|
||||
{
|
||||
putenv('COLUMNS=120');
|
||||
$application = new Application();
|
||||
$application->add(new \FooCommand());
|
||||
$application->add(new \Foo1Command());
|
||||
@ -1743,6 +1752,7 @@ class ApplicationTest extends TestCase
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
putenv($this->colSize ? 'COLUMNS' : 'COLUMNS='.$this->colSize);
|
||||
putenv('SHELL_VERBOSITY');
|
||||
unset($_ENV['SHELL_VERBOSITY']);
|
||||
unset($_SERVER['SHELL_VERBOSITY']);
|
||||
|
@ -23,6 +23,19 @@ use Symfony\Component\Console\Output\StreamOutput;
|
||||
*/
|
||||
class ProgressBarTest extends TestCase
|
||||
{
|
||||
private $colSize;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->colSize = getenv('COLUMNS');
|
||||
putenv('COLUMNS=120');
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
putenv($this->colSize ? 'COLUMNS' : 'COLUMNS='.$this->colSize);
|
||||
}
|
||||
|
||||
public function testMultipleStart()
|
||||
{
|
||||
$bar = new ProgressBar($output = $this->getOutputStream());
|
||||
|
@ -26,9 +26,11 @@ class SymfonyStyleTest extends TestCase
|
||||
protected $command;
|
||||
/** @var CommandTester */
|
||||
protected $tester;
|
||||
private $colSize;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->colSize = getenv('COLUMNS');
|
||||
putenv('COLUMNS=121');
|
||||
$this->command = new Command('sfstyle');
|
||||
$this->tester = new CommandTester($this->command);
|
||||
@ -36,7 +38,7 @@ class SymfonyStyleTest extends TestCase
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
putenv('COLUMNS');
|
||||
putenv($this->colSize ? 'COLUMNS' : 'COLUMNS='.$this->colSize);
|
||||
$this->command = null;
|
||||
$this->tester = null;
|
||||
}
|
||||
|
@ -16,6 +16,15 @@ use Symfony\Component\Console\Terminal;
|
||||
|
||||
class TerminalTest extends TestCase
|
||||
{
|
||||
private $colSize;
|
||||
private $lineSize;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->colSize = getenv('COLUMNS');
|
||||
$this->lineSize = getenv('LINES');
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
putenv('COLUMNS=100');
|
||||
@ -31,6 +40,12 @@ class TerminalTest extends TestCase
|
||||
$this->assertSame(60, $terminal->getHeight());
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
putenv($this->colSize ? 'COLUMNS' : 'COLUMNS='.$this->colSize);
|
||||
putenv($this->lineSize ? 'LINES' : 'LINES='.$this->lineSize);
|
||||
}
|
||||
|
||||
public function test_zero_values()
|
||||
{
|
||||
putenv('COLUMNS=0');
|
||||
|
Reference in New Issue
Block a user