4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Console\Tests;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Console\Terminal;
17 class TerminalTest extends TestCase
19 public function test()
21 putenv('COLUMNS=100');
23 $terminal = new Terminal();
24 $this->assertSame(100, $terminal->getWidth());
25 $this->assertSame(50, $terminal->getHeight());
27 putenv('COLUMNS=120');
29 $terminal = new Terminal();
30 $this->assertSame(120, $terminal->getWidth());
31 $this->assertSame(60, $terminal->getHeight());
34 public function test_zero_values()
39 $terminal = new Terminal();
41 $this->assertSame(0, $terminal->getWidth());
42 $this->assertSame(0, $terminal->getHeight());