RuntimeTest.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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\Runtime
  15. */
  16. final class RuntimeTest extends TestCase
  17. {
  18. /**
  19. * @var \SebastianBergmann\Environment\Runtime
  20. */
  21. private $env;
  22. protected function setUp()/*: void*/
  23. {
  24. $this->env = new Runtime;
  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 testAbilityToCollectCodeCoverageCanBeAssessed()/*: void*/
  31. {
  32. $this->assertInternalType('boolean', $this->env->canCollectCodeCoverage());
  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 testBinaryCanBeRetrieved()/*: void*/
  39. {
  40. $this->assertInternalType('string', $this->env->getBinary());
  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 testCanBeDetected()/*: void*/
  47. {
  48. $this->assertInternalType('boolean', $this->env->isHHVM());
  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 testCanBeDetected2()/*: void*/
  55. {
  56. $this->assertInternalType('boolean', $this->env->isPHP());
  57. }
  58. /**
  59. * @todo Now that this component is PHP 7-only and uses return type declarations
  60. * this test makes even less sense than before
  61. */
  62. public function testXdebugCanBeDetected()/*: void*/
  63. {
  64. $this->assertInternalType('boolean', $this->env->hasXdebug());
  65. }
  66. /**
  67. * @todo Now that this component is PHP 7-only and uses return type declarations
  68. * this test makes even less sense than before
  69. */
  70. public function testNameAndVersionCanBeRetrieved()/*: void*/
  71. {
  72. $this->assertInternalType('string', $this->env->getNameWithVersion());
  73. }
  74. /**
  75. * @todo Now that this component is PHP 7-only and uses return type declarations
  76. * this test makes even less sense than before
  77. */
  78. public function testNameCanBeRetrieved()/*: void*/
  79. {
  80. $this->assertInternalType('string', $this->env->getName());
  81. }
  82. /**
  83. * @todo Now that this component is PHP 7-only and uses return type declarations
  84. * this test makes even less sense than before
  85. */
  86. public function testVersionCanBeRetrieved()/*: void*/
  87. {
  88. $this->assertInternalType('string', $this->env->getVersion());
  89. }
  90. /**
  91. * @todo Now that this component is PHP 7-only and uses return type declarations
  92. * this test makes even less sense than before
  93. */
  94. public function testVendorUrlCanBeRetrieved()/*: void*/
  95. {
  96. $this->assertInternalType('string', $this->env->getVendorUrl());
  97. }
  98. }