RuntimeTest.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. /*
  3. * This file is part of the Environment package.
  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. class RuntimeTest extends PHPUnit_Framework_TestCase
  13. {
  14. /**
  15. * @var \SebastianBergmann\Environment\Runtime
  16. */
  17. private $env;
  18. protected function setUp()
  19. {
  20. $this->env = new Runtime;
  21. }
  22. /**
  23. * @covers \SebastianBergmann\Environment\Runtime::canCollectCodeCoverage
  24. *
  25. * @uses \SebastianBergmann\Environment\Runtime::hasXdebug
  26. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  27. * @uses \SebastianBergmann\Environment\Runtime::isPHP
  28. */
  29. public function testAbilityToCollectCodeCoverageCanBeAssessed()
  30. {
  31. $this->assertInternalType('boolean', $this->env->canCollectCodeCoverage());
  32. }
  33. /**
  34. * @covers \SebastianBergmann\Environment\Runtime::getBinary
  35. *
  36. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  37. */
  38. public function testBinaryCanBeRetrieved()
  39. {
  40. $this->assertInternalType('string', $this->env->getBinary());
  41. }
  42. /**
  43. * @covers \SebastianBergmann\Environment\Runtime::isHHVM
  44. */
  45. public function testCanBeDetected()
  46. {
  47. $this->assertInternalType('boolean', $this->env->isHHVM());
  48. }
  49. /**
  50. * @covers \SebastianBergmann\Environment\Runtime::isPHP
  51. *
  52. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  53. */
  54. public function testCanBeDetected2()
  55. {
  56. $this->assertInternalType('boolean', $this->env->isPHP());
  57. }
  58. /**
  59. * @covers \SebastianBergmann\Environment\Runtime::hasXdebug
  60. *
  61. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  62. * @uses \SebastianBergmann\Environment\Runtime::isPHP
  63. */
  64. public function testXdebugCanBeDetected()
  65. {
  66. $this->assertInternalType('boolean', $this->env->hasXdebug());
  67. }
  68. /**
  69. * @covers \SebastianBergmann\Environment\Runtime::getNameWithVersion
  70. *
  71. * @uses \SebastianBergmann\Environment\Runtime::getName
  72. * @uses \SebastianBergmann\Environment\Runtime::getVersion
  73. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  74. * @uses \SebastianBergmann\Environment\Runtime::isPHP
  75. */
  76. public function testNameAndVersionCanBeRetrieved()
  77. {
  78. $this->assertInternalType('string', $this->env->getNameWithVersion());
  79. }
  80. /**
  81. * @covers \SebastianBergmann\Environment\Runtime::getName
  82. *
  83. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  84. */
  85. public function testNameCanBeRetrieved()
  86. {
  87. $this->assertInternalType('string', $this->env->getName());
  88. }
  89. /**
  90. * @covers \SebastianBergmann\Environment\Runtime::getVersion
  91. *
  92. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  93. */
  94. public function testVersionCanBeRetrieved()
  95. {
  96. $this->assertInternalType('string', $this->env->getVersion());
  97. }
  98. /**
  99. * @covers \SebastianBergmann\Environment\Runtime::getVendorUrl
  100. *
  101. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  102. */
  103. public function testVendorUrlCanBeRetrieved()
  104. {
  105. $this->assertInternalType('string', $this->env->getVendorUrl());
  106. }
  107. }