ConsoleTest.php (1644B)
1 <?php 2 /* 3 * This file is part of the Environment package. 4 * 5 * (c) Sebastian Bergmann <sebastian@phpunit.de> 6 * 7 * For the full copyright and license information, please view the LICENSE 8 * file that was distributed with this source code. 9 */ 10 11 namespace SebastianBergmann\Environment; 12 13 use PHPUnit_Framework_TestCase; 14 15 class ConsoleTest extends PHPUnit_Framework_TestCase 16 { 17 /** 18 * @var \SebastianBergmann\Environment\Console 19 */ 20 private $console; 21 22 protected function setUp() 23 { 24 $this->console = new Console; 25 } 26 27 /** 28 * @covers \SebastianBergmann\Environment\Console::isInteractive 29 */ 30 public function testCanDetectIfStdoutIsInteractiveByDefault() 31 { 32 $this->assertInternalType('boolean', $this->console->isInteractive()); 33 } 34 35 /** 36 * @covers \SebastianBergmann\Environment\Console::isInteractive 37 */ 38 public function testCanDetectIfFileDescriptorIsInteractive() 39 { 40 $this->assertInternalType('boolean', $this->console->isInteractive(STDOUT)); 41 } 42 43 /** 44 * @covers \SebastianBergmann\Environment\Console::hasColorSupport 45 * @uses \SebastianBergmann\Environment\Console::isInteractive 46 */ 47 public function testCanDetectColorSupport() 48 { 49 $this->assertInternalType('boolean', $this->console->hasColorSupport()); 50 } 51 52 /** 53 * @covers \SebastianBergmann\Environment\Console::getNumberOfColumns 54 * @uses \SebastianBergmann\Environment\Console::isInteractive 55 */ 56 public function testCanDetectNumberOfColumns() 57 { 58 $this->assertInternalType('integer', $this->console->getNumberOfColumns()); 59 } 60 }