@@ -9,213 +9,213 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class CloudlinuxTest extends \PHPUnit_Framework_TestCase |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * @var Cloudlinux |
|
| 14 | - */ |
|
| 15 | - protected $object; |
|
| 16 | - |
|
| 17 | - /** |
|
| 18 | - * Sets up the fixture, for example, opens a network connection. |
|
| 19 | - * This method is called before a test is executed. |
|
| 20 | - */ |
|
| 21 | - protected function setUp() |
|
| 22 | - { |
|
| 23 | - if (file_exists(__DIR__.'/.env')) { |
|
| 24 | - $dotenv = new Dotenv\Dotenv(__DIR__); |
|
| 25 | - $dotenv->load(); |
|
| 26 | - } |
|
| 27 | - $this->object = new Cloudlinux(getenv('CLOUDLINUX_LOGIN'), getenv('CLOUDLINUX_KEY')); |
|
| 28 | - } |
|
| 29 | - |
|
| 30 | - /** |
|
| 31 | - * Tears down the fixture, for example, closes a network connection. |
|
| 32 | - * This method is called after a test is executed. |
|
| 33 | - */ |
|
| 34 | - protected function tearDown() |
|
| 35 | - { |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - public function testTestEnvironment() { |
|
| 39 | - $CLOUDLINUX_LOGIN = getenv('CLOUDLINUX_LOGIN'); |
|
| 40 | - $this->assertNotEmpty($CLOUDLINUX_LOGIN, 'No environment variables! Copy .env.example -> .env and fill out your account details.'); |
|
| 41 | - $this->assertInstanceOf('\Detain\Cloudlinux\Cloudlinux', $this->object); |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * @covers Detain\Cloudlinux\Cloudlinux::getcurlpage |
|
| 46 | - */ |
|
| 47 | - public function testGetcurlpage() |
|
| 48 | - { |
|
| 49 | - $this->assertRegExp('/<html/i', $this->object->getcurlpage('https://cln.cloudlinux.com')); |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * @covers Detain\Cloudlinux\Cloudlinux::status |
|
| 54 | - */ |
|
| 55 | - public function testStatus() |
|
| 56 | - { |
|
| 57 | - //Array( [success] => 1 [data] => Array([db_rhn_online] => 1 [db_clweb_connected] => 1 [db_clweb_online] => 1 [ip_server_reg] => 1 [xmlrpc] => 1 [rhn_overloaded] => [db_rhn_connected] => 1 ) ) |
|
| 58 | - // Remove the following lines when you implement this test. |
|
| 59 | - $status = $this->object->status(); |
|
| 60 | - $this->assertTrue(is_array($status)); |
|
| 61 | - $this->assertArrayHasKey('success', $status, 'Missing success status in response'); |
|
| 62 | - $this->assertArrayHasKey('data', $status, 'Missing data in response'); |
|
| 63 | - $this->assertEquals($status['data']['ip_server_reg'], 1, 'IP Server is not up'); |
|
| 64 | - } |
|
| 65 | - |
|
| 66 | - /** |
|
| 67 | - * @covers Detain\Cloudlinux\Cloudlinux::availability |
|
| 68 | - * @todo Implement testAvailability(). |
|
| 69 | - */ |
|
| 70 | - public function testAvailability() |
|
| 71 | - { |
|
| 72 | - // Remove the following lines when you implement this test. |
|
| 73 | - $this->markTestIncomplete( |
|
| 74 | - 'This test has not been implemented yet.' |
|
| 75 | - ); |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - /** |
|
| 79 | - * @covers Detain\Cloudlinux\Cloudlinux::check |
|
| 80 | - * @todo Implement testCheck(). |
|
| 81 | - */ |
|
| 82 | - public function testCheck() |
|
| 83 | - { |
|
| 84 | - // Remove the following lines when you implement this test. |
|
| 85 | - $this->markTestIncomplete( |
|
| 86 | - 'This test has not been implemented yet.' |
|
| 87 | - ); |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - /** |
|
| 91 | - * @covers Detain\Cloudlinux\Cloudlinux::register |
|
| 92 | - * @todo Implement testRegister(). |
|
| 93 | - */ |
|
| 94 | - public function testRegister() |
|
| 95 | - { |
|
| 96 | - // Remove the following lines when you implement this test. |
|
| 97 | - $this->markTestIncomplete( |
|
| 98 | - 'This test has not been implemented yet.' |
|
| 99 | - ); |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - /** |
|
| 103 | - * @covers Detain\Cloudlinux\Cloudlinux::rest_remove |
|
| 104 | - * @todo Implement testRest_remove(). |
|
| 105 | - */ |
|
| 106 | - public function testRest_remove() |
|
| 107 | - { |
|
| 108 | - // Remove the following lines when you implement this test. |
|
| 109 | - $this->markTestIncomplete( |
|
| 110 | - 'This test has not been implemented yet.' |
|
| 111 | - ); |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - /** |
|
| 115 | - * @covers Detain\Cloudlinux\Cloudlinux::remove |
|
| 116 | - * @todo Implement testRemove(). |
|
| 117 | - */ |
|
| 118 | - public function testRemove() |
|
| 119 | - { |
|
| 120 | - // Remove the following lines when you implement this test. |
|
| 121 | - $this->markTestIncomplete( |
|
| 122 | - 'This test has not been implemented yet.' |
|
| 123 | - ); |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - /** |
|
| 127 | - * @covers Detain\Cloudlinux\Cloudlinux::rest_list |
|
| 128 | - * @todo Implement testRest_list(). |
|
| 129 | - */ |
|
| 130 | - public function testRest_list() |
|
| 131 | - { |
|
| 132 | - // Remove the following lines when you implement this test. |
|
| 133 | - $this->markTestIncomplete( |
|
| 134 | - 'This test has not been implemented yet.' |
|
| 135 | - ); |
|
| 136 | - } |
|
| 137 | - |
|
| 138 | - /** |
|
| 139 | - * @covers Detain\Cloudlinux\Cloudlinux::authToken |
|
| 140 | - * @todo Implement testAuthToken(). |
|
| 141 | - */ |
|
| 142 | - public function testAuthToken() |
|
| 143 | - { |
|
| 144 | - // Remove the following lines when you implement this test. |
|
| 145 | - $this->markTestIncomplete( |
|
| 146 | - 'This test has not been implemented yet.' |
|
| 147 | - ); |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * @covers Detain\Cloudlinux\Cloudlinux::license |
|
| 152 | - * @todo Implement testLicense(). |
|
| 153 | - */ |
|
| 154 | - public function testLicense() |
|
| 155 | - { |
|
| 156 | - // Remove the following lines when you implement this test. |
|
| 157 | - $this->markTestIncomplete( |
|
| 158 | - 'This test has not been implemented yet.' |
|
| 159 | - ); |
|
| 160 | - } |
|
| 161 | - |
|
| 162 | - /** |
|
| 163 | - * @covers Detain\Cloudlinux\Cloudlinux::remove_license |
|
| 164 | - * @todo Implement testRemove_license(). |
|
| 165 | - */ |
|
| 166 | - public function testRemove_license() |
|
| 167 | - { |
|
| 168 | - // Remove the following lines when you implement this test. |
|
| 169 | - $this->markTestIncomplete( |
|
| 170 | - 'This test has not been implemented yet.' |
|
| 171 | - ); |
|
| 172 | - } |
|
| 173 | - |
|
| 174 | - /** |
|
| 175 | - * @covers Detain\Cloudlinux\Cloudlinux::is_licensed |
|
| 176 | - * @todo Implement testIs_licensed(). |
|
| 177 | - */ |
|
| 178 | - public function testIs_licensed() |
|
| 179 | - { |
|
| 180 | - // Remove the following lines when you implement this test. |
|
| 181 | - $this->markTestIncomplete( |
|
| 182 | - 'This test has not been implemented yet.' |
|
| 183 | - ); |
|
| 184 | - } |
|
| 185 | - |
|
| 186 | - /** |
|
| 187 | - * @covers Detain\Cloudlinux\Cloudlinux::xml_is_licensed |
|
| 188 | - * @todo Implement testXml_is_licensed(). |
|
| 189 | - */ |
|
| 190 | - public function testXml_is_licensed() |
|
| 191 | - { |
|
| 192 | - // Remove the following lines when you implement this test. |
|
| 193 | - $this->markTestIncomplete( |
|
| 194 | - 'This test has not been implemented yet.' |
|
| 195 | - ); |
|
| 196 | - } |
|
| 197 | - |
|
| 198 | - /** |
|
| 199 | - * @covers Detain\Cloudlinux\Cloudlinux::license_list |
|
| 200 | - * @todo Implement testLicense_list(). |
|
| 201 | - */ |
|
| 202 | - public function testLicense_list() |
|
| 203 | - { |
|
| 204 | - // Remove the following lines when you implement this test. |
|
| 205 | - $this->markTestIncomplete( |
|
| 206 | - 'This test has not been implemented yet.' |
|
| 207 | - ); |
|
| 208 | - } |
|
| 209 | - |
|
| 210 | - /** |
|
| 211 | - * @covers Detain\Cloudlinux\Cloudlinux::reconcile |
|
| 212 | - * @todo Implement testReconcile(). |
|
| 213 | - */ |
|
| 214 | - public function testReconcile() |
|
| 215 | - { |
|
| 216 | - // Remove the following lines when you implement this test. |
|
| 217 | - $this->markTestIncomplete( |
|
| 218 | - 'This test has not been implemented yet.' |
|
| 219 | - ); |
|
| 220 | - } |
|
| 12 | + /** |
|
| 13 | + * @var Cloudlinux |
|
| 14 | + */ |
|
| 15 | + protected $object; |
|
| 16 | + |
|
| 17 | + /** |
|
| 18 | + * Sets up the fixture, for example, opens a network connection. |
|
| 19 | + * This method is called before a test is executed. |
|
| 20 | + */ |
|
| 21 | + protected function setUp() |
|
| 22 | + { |
|
| 23 | + if (file_exists(__DIR__.'/.env')) { |
|
| 24 | + $dotenv = new Dotenv\Dotenv(__DIR__); |
|
| 25 | + $dotenv->load(); |
|
| 26 | + } |
|
| 27 | + $this->object = new Cloudlinux(getenv('CLOUDLINUX_LOGIN'), getenv('CLOUDLINUX_KEY')); |
|
| 28 | + } |
|
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * Tears down the fixture, for example, closes a network connection. |
|
| 32 | + * This method is called after a test is executed. |
|
| 33 | + */ |
|
| 34 | + protected function tearDown() |
|
| 35 | + { |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + public function testTestEnvironment() { |
|
| 39 | + $CLOUDLINUX_LOGIN = getenv('CLOUDLINUX_LOGIN'); |
|
| 40 | + $this->assertNotEmpty($CLOUDLINUX_LOGIN, 'No environment variables! Copy .env.example -> .env and fill out your account details.'); |
|
| 41 | + $this->assertInstanceOf('\Detain\Cloudlinux\Cloudlinux', $this->object); |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * @covers Detain\Cloudlinux\Cloudlinux::getcurlpage |
|
| 46 | + */ |
|
| 47 | + public function testGetcurlpage() |
|
| 48 | + { |
|
| 49 | + $this->assertRegExp('/<html/i', $this->object->getcurlpage('https://cln.cloudlinux.com')); |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * @covers Detain\Cloudlinux\Cloudlinux::status |
|
| 54 | + */ |
|
| 55 | + public function testStatus() |
|
| 56 | + { |
|
| 57 | + //Array( [success] => 1 [data] => Array([db_rhn_online] => 1 [db_clweb_connected] => 1 [db_clweb_online] => 1 [ip_server_reg] => 1 [xmlrpc] => 1 [rhn_overloaded] => [db_rhn_connected] => 1 ) ) |
|
| 58 | + // Remove the following lines when you implement this test. |
|
| 59 | + $status = $this->object->status(); |
|
| 60 | + $this->assertTrue(is_array($status)); |
|
| 61 | + $this->assertArrayHasKey('success', $status, 'Missing success status in response'); |
|
| 62 | + $this->assertArrayHasKey('data', $status, 'Missing data in response'); |
|
| 63 | + $this->assertEquals($status['data']['ip_server_reg'], 1, 'IP Server is not up'); |
|
| 64 | + } |
|
| 65 | + |
|
| 66 | + /** |
|
| 67 | + * @covers Detain\Cloudlinux\Cloudlinux::availability |
|
| 68 | + * @todo Implement testAvailability(). |
|
| 69 | + */ |
|
| 70 | + public function testAvailability() |
|
| 71 | + { |
|
| 72 | + // Remove the following lines when you implement this test. |
|
| 73 | + $this->markTestIncomplete( |
|
| 74 | + 'This test has not been implemented yet.' |
|
| 75 | + ); |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * @covers Detain\Cloudlinux\Cloudlinux::check |
|
| 80 | + * @todo Implement testCheck(). |
|
| 81 | + */ |
|
| 82 | + public function testCheck() |
|
| 83 | + { |
|
| 84 | + // Remove the following lines when you implement this test. |
|
| 85 | + $this->markTestIncomplete( |
|
| 86 | + 'This test has not been implemented yet.' |
|
| 87 | + ); |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + /** |
|
| 91 | + * @covers Detain\Cloudlinux\Cloudlinux::register |
|
| 92 | + * @todo Implement testRegister(). |
|
| 93 | + */ |
|
| 94 | + public function testRegister() |
|
| 95 | + { |
|
| 96 | + // Remove the following lines when you implement this test. |
|
| 97 | + $this->markTestIncomplete( |
|
| 98 | + 'This test has not been implemented yet.' |
|
| 99 | + ); |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + /** |
|
| 103 | + * @covers Detain\Cloudlinux\Cloudlinux::rest_remove |
|
| 104 | + * @todo Implement testRest_remove(). |
|
| 105 | + */ |
|
| 106 | + public function testRest_remove() |
|
| 107 | + { |
|
| 108 | + // Remove the following lines when you implement this test. |
|
| 109 | + $this->markTestIncomplete( |
|
| 110 | + 'This test has not been implemented yet.' |
|
| 111 | + ); |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + /** |
|
| 115 | + * @covers Detain\Cloudlinux\Cloudlinux::remove |
|
| 116 | + * @todo Implement testRemove(). |
|
| 117 | + */ |
|
| 118 | + public function testRemove() |
|
| 119 | + { |
|
| 120 | + // Remove the following lines when you implement this test. |
|
| 121 | + $this->markTestIncomplete( |
|
| 122 | + 'This test has not been implemented yet.' |
|
| 123 | + ); |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + /** |
|
| 127 | + * @covers Detain\Cloudlinux\Cloudlinux::rest_list |
|
| 128 | + * @todo Implement testRest_list(). |
|
| 129 | + */ |
|
| 130 | + public function testRest_list() |
|
| 131 | + { |
|
| 132 | + // Remove the following lines when you implement this test. |
|
| 133 | + $this->markTestIncomplete( |
|
| 134 | + 'This test has not been implemented yet.' |
|
| 135 | + ); |
|
| 136 | + } |
|
| 137 | + |
|
| 138 | + /** |
|
| 139 | + * @covers Detain\Cloudlinux\Cloudlinux::authToken |
|
| 140 | + * @todo Implement testAuthToken(). |
|
| 141 | + */ |
|
| 142 | + public function testAuthToken() |
|
| 143 | + { |
|
| 144 | + // Remove the following lines when you implement this test. |
|
| 145 | + $this->markTestIncomplete( |
|
| 146 | + 'This test has not been implemented yet.' |
|
| 147 | + ); |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * @covers Detain\Cloudlinux\Cloudlinux::license |
|
| 152 | + * @todo Implement testLicense(). |
|
| 153 | + */ |
|
| 154 | + public function testLicense() |
|
| 155 | + { |
|
| 156 | + // Remove the following lines when you implement this test. |
|
| 157 | + $this->markTestIncomplete( |
|
| 158 | + 'This test has not been implemented yet.' |
|
| 159 | + ); |
|
| 160 | + } |
|
| 161 | + |
|
| 162 | + /** |
|
| 163 | + * @covers Detain\Cloudlinux\Cloudlinux::remove_license |
|
| 164 | + * @todo Implement testRemove_license(). |
|
| 165 | + */ |
|
| 166 | + public function testRemove_license() |
|
| 167 | + { |
|
| 168 | + // Remove the following lines when you implement this test. |
|
| 169 | + $this->markTestIncomplete( |
|
| 170 | + 'This test has not been implemented yet.' |
|
| 171 | + ); |
|
| 172 | + } |
|
| 173 | + |
|
| 174 | + /** |
|
| 175 | + * @covers Detain\Cloudlinux\Cloudlinux::is_licensed |
|
| 176 | + * @todo Implement testIs_licensed(). |
|
| 177 | + */ |
|
| 178 | + public function testIs_licensed() |
|
| 179 | + { |
|
| 180 | + // Remove the following lines when you implement this test. |
|
| 181 | + $this->markTestIncomplete( |
|
| 182 | + 'This test has not been implemented yet.' |
|
| 183 | + ); |
|
| 184 | + } |
|
| 185 | + |
|
| 186 | + /** |
|
| 187 | + * @covers Detain\Cloudlinux\Cloudlinux::xml_is_licensed |
|
| 188 | + * @todo Implement testXml_is_licensed(). |
|
| 189 | + */ |
|
| 190 | + public function testXml_is_licensed() |
|
| 191 | + { |
|
| 192 | + // Remove the following lines when you implement this test. |
|
| 193 | + $this->markTestIncomplete( |
|
| 194 | + 'This test has not been implemented yet.' |
|
| 195 | + ); |
|
| 196 | + } |
|
| 197 | + |
|
| 198 | + /** |
|
| 199 | + * @covers Detain\Cloudlinux\Cloudlinux::license_list |
|
| 200 | + * @todo Implement testLicense_list(). |
|
| 201 | + */ |
|
| 202 | + public function testLicense_list() |
|
| 203 | + { |
|
| 204 | + // Remove the following lines when you implement this test. |
|
| 205 | + $this->markTestIncomplete( |
|
| 206 | + 'This test has not been implemented yet.' |
|
| 207 | + ); |
|
| 208 | + } |
|
| 209 | + |
|
| 210 | + /** |
|
| 211 | + * @covers Detain\Cloudlinux\Cloudlinux::reconcile |
|
| 212 | + * @todo Implement testReconcile(). |
|
| 213 | + */ |
|
| 214 | + public function testReconcile() |
|
| 215 | + { |
|
| 216 | + // Remove the following lines when you implement this test. |
|
| 217 | + $this->markTestIncomplete( |
|
| 218 | + 'This test has not been implemented yet.' |
|
| 219 | + ); |
|
| 220 | + } |
|
| 221 | 221 | } |