ConsoleTest.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php declare(strict_types=1);
  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. namespace SebastianBergmann\Environment;
  11. use const STDOUT;
  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->assertIsBool($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->assertIsBool($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->assertIsBool($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->assertIsInt($this->console->getNumberOfColumns());
  57. }
  58. }