TerminalTest.php 832 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Console\Tests;
  11. use Symfony\Component\Console\Terminal;
  12. class TerminalTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function test()
  15. {
  16. putenv('COLUMNS=100');
  17. putenv('LINES=50');
  18. $terminal = new Terminal();
  19. $this->assertSame(100, $terminal->getWidth());
  20. $this->assertSame(50, $terminal->getHeight());
  21. putenv('COLUMNS=120');
  22. putenv('LINES=60');
  23. $terminal = new Terminal();
  24. $this->assertSame(120, $terminal->getWidth());
  25. $this->assertSame(60, $terminal->getHeight());
  26. }
  27. }