ConsoleTest.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /*
  3. * This file is part of sebastian/environment.
  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. declare(strict_types=1);
  11. namespace SebastianBergmann\Environment;
  12. use PHPUnit\Framework\TestCase;
  13. /**
  14. * @covers \SebastianBergmann\Environment\Console
  15. */
  16. final class ConsoleTest extends TestCase
  17. {
  18. /**
  19. * @var \SebastianBergmann\Environment\Console
  20. */
  21. private $console;
  22. protected function setUp()/*: void*/
  23. {
  24. $this->console = new Console;
  25. }
  26. /**
  27. * @todo Now that this component is PHP 7-only and uses return type declarations
  28. * this test makes even less sense than before
  29. */
  30. public function testCanDetectIfStdoutIsInteractiveByDefault()/*: void*/
  31. {
  32. $this->assertInternalType('boolean', $this->console->isInteractive());
  33. }
  34. /**
  35. * @todo Now that this component is PHP 7-only and uses return type declarations
  36. * this test makes even less sense than before
  37. */
  38. public function testCanDetectIfFileDescriptorIsInteractive()/*: void*/
  39. {
  40. $this->assertInternalType('boolean', $this->console->isInteractive(STDOUT));
  41. }
  42. /**
  43. * @todo Now that this component is PHP 7-only and uses return type declarations
  44. * this test makes even less sense than before
  45. */
  46. public function testCanDetectColorSupport()/*: void*/
  47. {
  48. $this->assertInternalType('boolean', $this->console->hasColorSupport());
  49. }
  50. /**
  51. * @todo Now that this component is PHP 7-only and uses return type declarations
  52. * this test makes even less sense than before
  53. */
  54. public function testCanDetectNumberOfColumns()/*: void*/
  55. {
  56. $this->assertInternalType('integer', $this->console->getNumberOfColumns());
  57. }
  58. }