RuntimeTest.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. * @uses \SebastianBergmann\Environment\Runtime::hasXdebug
  25. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  26. * @uses \SebastianBergmann\Environment\Runtime::isPHP
  27. */
  28. public function testAbilityToCollectCodeCoverageCanBeAssessed()
  29. {
  30. $this->assertInternalType('boolean', $this->env->canCollectCodeCoverage());
  31. }
  32. /**
  33. * @covers \SebastianBergmann\Environment\Runtime::getBinary
  34. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  35. */
  36. public function testBinaryCanBeRetrieved()
  37. {
  38. $this->assertInternalType('string', $this->env->getBinary());
  39. }
  40. /**
  41. * @covers \SebastianBergmann\Environment\Runtime::isHHVM
  42. */
  43. public function testCanBeDetected()
  44. {
  45. $this->assertInternalType('boolean', $this->env->isHHVM());
  46. }
  47. /**
  48. * @covers \SebastianBergmann\Environment\Runtime::isPHP
  49. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  50. */
  51. public function testCanBeDetected2()
  52. {
  53. $this->assertInternalType('boolean', $this->env->isPHP());
  54. }
  55. /**
  56. * @covers \SebastianBergmann\Environment\Runtime::hasXdebug
  57. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  58. * @uses \SebastianBergmann\Environment\Runtime::isPHP
  59. */
  60. public function testXdebugCanBeDetected()
  61. {
  62. $this->assertInternalType('boolean', $this->env->hasXdebug());
  63. }
  64. /**
  65. * @covers \SebastianBergmann\Environment\Runtime::getNameWithVersion
  66. * @uses \SebastianBergmann\Environment\Runtime::getName
  67. * @uses \SebastianBergmann\Environment\Runtime::getVersion
  68. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  69. * @uses \SebastianBergmann\Environment\Runtime::isPHP
  70. */
  71. public function testNameAndVersionCanBeRetrieved()
  72. {
  73. $this->assertInternalType('string', $this->env->getNameWithVersion());
  74. }
  75. /**
  76. * @covers \SebastianBergmann\Environment\Runtime::getName
  77. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  78. */
  79. public function testNameCanBeRetrieved()
  80. {
  81. $this->assertInternalType('string', $this->env->getName());
  82. }
  83. /**
  84. * @covers \SebastianBergmann\Environment\Runtime::getVersion
  85. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  86. */
  87. public function testVersionCanBeRetrieved()
  88. {
  89. $this->assertInternalType('string', $this->env->getVersion());
  90. }
  91. /**
  92. * @covers \SebastianBergmann\Environment\Runtime::getVendorUrl
  93. * @uses \SebastianBergmann\Environment\Runtime::isHHVM
  94. */
  95. public function testVendorUrlCanBeRetrieved()
  96. {
  97. $this->assertInternalType('string', $this->env->getVendorUrl());
  98. }
  99. }