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      *
46      * @uses   \SebastianBergmann\Environment\Console::isInteractive
47      */
48     public function testCanDetectColorSupport()
49     {
50         $this->assertInternalType('boolean', $this->console->hasColorSupport());
51     }
52 
53     /**
54      * @covers \SebastianBergmann\Environment\Console::getNumberOfColumns
55      *
56      * @uses   \SebastianBergmann\Environment\Console::isInteractive
57      */
58     public function testCanDetectNumberOfColumns()
59     {
60         $this->assertInternalType('integer', $this->console->getNumberOfColumns());
61     }
62 }
63