diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index 85484b5c5a..200568f070 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -48,6 +48,14 @@ class ApplicationTest extends TestCase $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() { self::$fixturesPath = realpath(__DIR__.'/Fixtures/'); @@ -1698,14 +1706,6 @@ class ApplicationTest extends TestCase $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 diff --git a/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php b/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php index 214e943d73..a0be9b8a6d 100644 --- a/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php @@ -31,7 +31,7 @@ class ProgressBarTest extends TestCase protected function tearDown() { - putenv($this->colSize ? 'COLUMNS' : 'COLUMNS='.$this->colSize); + putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS'); } public function testMultipleStart() diff --git a/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php b/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php index a6feb122a1..88d00c8a99 100644 --- a/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php +++ b/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php @@ -38,7 +38,7 @@ class SymfonyStyleTest extends TestCase protected function tearDown() { - putenv($this->colSize ? 'COLUMNS' : 'COLUMNS='.$this->colSize); + putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS'); $this->command = null; $this->tester = null; } diff --git a/src/Symfony/Component/Console/Tests/TerminalTest.php b/src/Symfony/Component/Console/Tests/TerminalTest.php index ca3b874374..93b8c44a78 100644 --- a/src/Symfony/Component/Console/Tests/TerminalTest.php +++ b/src/Symfony/Component/Console/Tests/TerminalTest.php @@ -25,6 +25,12 @@ class TerminalTest extends TestCase $this->lineSize = getenv('LINES'); } + protected function tearDown() + { + putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS'); + putenv($this->lineSize ? 'LINES' : 'LINES='.$this->lineSize); + } + public function test() { putenv('COLUMNS=100'); @@ -40,12 +46,6 @@ 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');