SystemInformationTest.php (1279B)
1 <?php 2 3 namespace PartKeepr\CoreBundle\Tests; 4 5 class SystemInformationTest extends WebTestCase 6 { 7 public function testSystemInformation() 8 { 9 $client = static::makeClient(true); 10 11 $client->request( 12 'GET', 13 '/api/system_information' 14 ); 15 16 $response = json_decode($client->getResponse()->getContent()); 17 18 $this->assertInternalType('array', $response); 19 20 $this->assertInternalType('object', $response[0]); 21 $this->assertObjectHasAttribute('category', $response[0]); 22 $this->assertObjectHasAttribute('name', $response[0]); 23 $this->assertObjectHasAttribute('value', $response[0]); 24 } 25 26 public function testSystemStatus() 27 { 28 $client = static::makeClient(true); 29 30 $client->request( 31 'GET', 32 '/api/system_status' 33 ); 34 35 $response = json_decode($client->getResponse()->getContent()); 36 37 $this->assertInternalType('object', $response); 38 $this->assertObjectHasAttribute('inactiveCronjobCount', $response); 39 $this->assertObjectHasAttribute('inactiveCronjobs', $response); 40 $this->assertInternalType('array', $response->inactiveCronjobs); 41 $this->assertObjectHasAttribute('schemaStatus', $response); 42 } 43 }