RuntimeTest.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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\Runtime
  14. */
  15. final class RuntimeTest extends TestCase
  16. {
  17. /**
  18. * @var \SebastianBergmann\Environment\Runtime
  19. */
  20. private $env;
  21. protected function setUp(): void
  22. {
  23. $this->env = new Runtime;
  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 testAbilityToCollectCodeCoverageCanBeAssessed(): void
  30. {
  31. $this->assertIsBool($this->env->canCollectCodeCoverage());
  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 testBinaryCanBeRetrieved(): void
  38. {
  39. $this->assertIsString($this->env->getBinary());
  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 testCanBeDetected(): void
  46. {
  47. $this->assertIsBool($this->env->isHHVM());
  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 testCanBeDetected2(): void
  54. {
  55. $this->assertIsBool($this->env->isPHP());
  56. }
  57. /**
  58. * @todo Now that this component is PHP 7-only and uses return type declarations
  59. * this test makes even less sense than before
  60. */
  61. public function testPCOVCanBeDetected(): void
  62. {
  63. $this->assertIsBool($this->env->hasPCOV());
  64. }
  65. /**
  66. * @todo Now that this component is PHP 7-only and uses return type declarations
  67. * this test makes even less sense than before
  68. */
  69. public function testXdebugCanBeDetected(): void
  70. {
  71. $this->assertIsBool($this->env->hasXdebug());
  72. }
  73. /**
  74. * @todo Now that this component is PHP 7-only and uses return type declarations
  75. * this test makes even less sense than before
  76. */
  77. public function testNameAndVersionCanBeRetrieved(): void
  78. {
  79. $this->assertIsString($this->env->getNameWithVersion());
  80. }
  81. /**
  82. * @todo Now that this component is PHP 7-only and uses return type declarations
  83. * this test makes even less sense than before
  84. */
  85. public function testNameCanBeRetrieved(): void
  86. {
  87. $this->assertIsString($this->env->getName());
  88. }
  89. /**
  90. * @todo Now that this component is PHP 7-only and uses return type declarations
  91. * this test makes even less sense than before
  92. */
  93. public function testNameAndCodeCoverageDriverCanBeRetrieved(): void
  94. {
  95. $this->assertIsString($this->env->getNameWithVersionAndCodeCoverageDriver());
  96. }
  97. /**
  98. * @todo Now that this component is PHP 7-only and uses return type declarations
  99. * this test makes even less sense than before
  100. */
  101. public function testVersionCanBeRetrieved(): void
  102. {
  103. $this->assertIsString($this->env->getVersion());
  104. }
  105. /**
  106. * @todo Now that this component is PHP 7-only and uses return type declarations
  107. * this test makes even less sense than before
  108. */
  109. public function testVendorUrlCanBeRetrieved(): void
  110. {
  111. $this->assertIsString($this->env->getVendorUrl());
  112. }
  113. }