ConsoleTest.php 1.8 KB

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