1 | <?php |
||
11 | class CloudlinuxTest extends TestCase |
||
12 | { |
||
13 | /** |
||
14 | * @var Cloudlinux |
||
15 | */ |
||
16 | protected $object; |
||
17 | |||
18 | /** |
||
19 | * Sets up the fixture, for example, opens a network connection. |
||
20 | * This method is called before a test is executed. |
||
21 | */ |
||
22 | protected function setUp() |
||
23 | { |
||
24 | if (file_exists(__DIR__.'/.env')) { |
||
25 | $dotenv = new Dotenv\Dotenv(__DIR__); |
||
26 | $dotenv->load(); |
||
27 | } |
||
28 | $this->object = new Cloudlinux(getenv('CLOUDLINUX_LOGIN'), getenv('CLOUDLINUX_KEY')); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Tears down the fixture, for example, closes a network connection. |
||
33 | * This method is called after a test is executed. |
||
34 | */ |
||
35 | protected function tearDown() |
||
36 | { |
||
37 | } |
||
38 | |||
39 | public function testTestEnvironment() { |
||
40 | $CLOUDLINUX_LOGIN = getenv('CLOUDLINUX_LOGIN'); |
||
41 | $this->assertNotEmpty($CLOUDLINUX_LOGIN, 'No environment variables! Copy .env.example -> .env and fill out your account details.'); |
||
42 | $this->assertInstanceOf('\Detain\Cloudlinux\Cloudlinux', $this->object); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @covers Detain\Cloudlinux\Cloudlinux::getcurlpage |
||
47 | */ |
||
48 | public function testGetcurlpage() |
||
52 | |||
53 | /** |
||
54 | * @covers Detain\Cloudlinux\Cloudlinux::status |
||
55 | */ |
||
56 | public function testStatus() |
||
66 | |||
67 | /** |
||
68 | * @covers Detain\Cloudlinux\Cloudlinux::availability |
||
69 | * @todo Implement testAvailability(). |
||
70 | */ |
||
71 | public function testAvailability() |
||
78 | |||
79 | /** |
||
80 | * @covers Detain\Cloudlinux\Cloudlinux::check |
||
81 | * @todo Implement testCheck(). |
||
82 | */ |
||
83 | public function testCheck() |
||
90 | |||
91 | /** |
||
92 | * @covers Detain\Cloudlinux\Cloudlinux::register |
||
93 | * @todo Implement testRegister(). |
||
94 | */ |
||
95 | public function testRegister() |
||
102 | |||
103 | /** |
||
104 | * @covers Detain\Cloudlinux\Cloudlinux::rest_remove |
||
105 | * @todo Implement testRest_remove(). |
||
106 | */ |
||
107 | public function testRest_remove() |
||
114 | |||
115 | /** |
||
116 | * @covers Detain\Cloudlinux\Cloudlinux::remove |
||
117 | * @todo Implement testRemove(). |
||
118 | */ |
||
119 | public function testRemove() |
||
126 | |||
127 | /** |
||
128 | * @covers Detain\Cloudlinux\Cloudlinux::rest_list |
||
129 | * @todo Implement testRest_list(). |
||
130 | */ |
||
131 | public function testRest_list() |
||
138 | |||
139 | /** |
||
140 | * @covers Detain\Cloudlinux\Cloudlinux::authToken |
||
141 | * @todo Implement testAuthToken(). |
||
142 | */ |
||
143 | public function testAuthToken() |
||
150 | |||
151 | /** |
||
152 | * @covers Detain\Cloudlinux\Cloudlinux::license |
||
153 | * @todo Implement testLicense(). |
||
154 | */ |
||
155 | public function testLicense() |
||
162 | |||
163 | /** |
||
164 | * @covers Detain\Cloudlinux\Cloudlinux::remove_license |
||
165 | * @todo Implement testRemove_license(). |
||
166 | */ |
||
167 | public function testRemove_license() |
||
174 | |||
175 | /** |
||
176 | * @covers Detain\Cloudlinux\Cloudlinux::isLicensed |
||
177 | * @todo Implement testIs_licensed(). |
||
178 | */ |
||
179 | public function testIs_licensed() |
||
186 | |||
187 | /** |
||
188 | * @covers Detain\Cloudlinux\Cloudlinux::xmlIsLicensed |
||
189 | * @todo Implement testXml_isLicensed(). |
||
190 | */ |
||
191 | public function testXml_isLicensed() |
||
192 | { |
||
193 | // Remove the following lines when you implement this test. |
||
194 | $this->markTestIncomplete( |
||
195 | 'This test has not been implemented yet.' |
||
196 | ); |
||
197 | } |
||
198 | |||
199 | /** |
||
200 | * @covers Detain\Cloudlinux\Cloudlinux::licenseList |
||
201 | * @todo Implement testLicense_list(). |
||
202 | */ |
||
203 | public function testLicense_list() |
||
210 | |||
211 | /** |
||
212 | * @covers Detain\Cloudlinux\Cloudlinux::reconcile |
||
213 | * @todo Implement testReconcile(). |
||
214 | */ |
||
215 | public function testReconcile() |
||
222 | } |
||
223 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.