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