fix resetting the COLUMN environment variable

This commit is contained in:
Christian Flothmann 2019-04-08 11:27:09 +02:00
parent d7a8b3d5e1
commit 8fb2074972
4 changed files with 16 additions and 16 deletions

View File

@ -48,6 +48,14 @@ class ApplicationTest extends TestCase
$this->colSize = getenv('COLUMNS'); $this->colSize = getenv('COLUMNS');
} }
protected function tearDown()
{
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
putenv('SHELL_VERBOSITY');
unset($_ENV['SHELL_VERBOSITY']);
unset($_SERVER['SHELL_VERBOSITY']);
}
public static function setUpBeforeClass() public static function setUpBeforeClass()
{ {
self::$fixturesPath = realpath(__DIR__.'/Fixtures/'); self::$fixturesPath = realpath(__DIR__.'/Fixtures/');
@ -1698,14 +1706,6 @@ class ApplicationTest extends TestCase
$this->assertSame($e->getMessage(), 'Class \'UnknownClass\' not found'); $this->assertSame($e->getMessage(), 'Class \'UnknownClass\' not found');
} }
} }
protected function tearDown()
{
putenv($this->colSize ? 'COLUMNS' : 'COLUMNS='.$this->colSize);
putenv('SHELL_VERBOSITY');
unset($_ENV['SHELL_VERBOSITY']);
unset($_SERVER['SHELL_VERBOSITY']);
}
} }
class CustomApplication extends Application class CustomApplication extends Application

View File

@ -31,7 +31,7 @@ class ProgressBarTest extends TestCase
protected function tearDown() protected function tearDown()
{ {
putenv($this->colSize ? 'COLUMNS' : 'COLUMNS='.$this->colSize); putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
} }
public function testMultipleStart() public function testMultipleStart()

View File

@ -38,7 +38,7 @@ class SymfonyStyleTest extends TestCase
protected function tearDown() protected function tearDown()
{ {
putenv($this->colSize ? 'COLUMNS' : 'COLUMNS='.$this->colSize); putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
$this->command = null; $this->command = null;
$this->tester = null; $this->tester = null;
} }

View File

@ -25,6 +25,12 @@ class TerminalTest extends TestCase
$this->lineSize = getenv('LINES'); $this->lineSize = getenv('LINES');
} }
protected function tearDown()
{
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
putenv($this->lineSize ? 'LINES' : 'LINES='.$this->lineSize);
}
public function test() public function test()
{ {
putenv('COLUMNS=100'); putenv('COLUMNS=100');
@ -40,12 +46,6 @@ class TerminalTest extends TestCase
$this->assertSame(60, $terminal->getHeight()); $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() public function test_zero_values()
{ {
putenv('COLUMNS=0'); putenv('COLUMNS=0');