Skip to content

Commit

Permalink
fix tests relative to changes in 37a0e50
Browse files Browse the repository at this point in the history
  • Loading branch information
orthagh committed Sep 15, 2016
1 parent 37a0e50 commit 10558a1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
13 changes: 8 additions & 5 deletions tests/API/APIRestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ public function testGetMyEntities($session_token) {
$body = $res->getBody();
$data = json_decode($body, true);
$this->assertNotEquals(false, $data);
$this->assertArrayHasKey(0, $data); // check presence of root entity
$this->assertArrayHasKey('id', $data[0]); // check presence of first entity
$this->assertEquals(0, $data[0]['id']); // check presence of root entity
}


Expand All @@ -165,9 +166,10 @@ public function testGetActiveEntities($session_token) {
$data = json_decode($body, true);
$this->assertNotEquals(false, $data);
$this->assertArrayHasKey('active_entity', $data);
$this->assertArrayHasKey('active_entity_recursive', $data);
$this->assertArrayHasKey('active_entities', $data);
$this->assertTrue(is_array($data['active_entities']), $data);
$this->assertArrayHasKey('id', $data['active_entity']);
$this->assertArrayHasKey('active_entity_recursive', $data['active_entity']);
$this->assertArrayHasKey('active_entities', $data['active_entity']);
$this->assertTrue(is_array($data['active_entity']['active_entities']));
}


Expand Down Expand Up @@ -198,7 +200,8 @@ public function testGetMyProfiles($session_token) {
$body = $res->getBody();
$data = json_decode($body, true);
$this->assertNotEquals(false, $data);
$this->assertArrayHasKey(4, $data); // check presence of super-admin profile
$this->assertArrayHasKey('myprofiles', $data); // check presence of root key
$this->assertArrayHasKey('id', $data['myprofiles'][0]); // check presence of id key in first entity
}


Expand Down
11 changes: 7 additions & 4 deletions tests/API/APIXmlrpcTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ public function testGetActiveEntities($session_token) {
$data = xmlrpc_decode($res->getBody());
$this->assertNotEquals(false, $data);
$this->assertArrayHasKey('active_entity', $data);
$this->assertArrayHasKey('active_entity_recursive', $data);
$this->assertArrayHasKey('active_entities', $data);
$this->assertTrue(is_array($data['active_entities']), $data);
$this->assertArrayHasKey('id', $data['active_entity']);
$this->assertArrayHasKey('active_entity_recursive', $data['active_entity']);
$this->assertArrayHasKey('active_entities', $data['active_entity']);
$this->assertTrue(is_array($data['active_entity']['active_entities']));
}


Expand All @@ -140,7 +141,9 @@ public function testGetMyProfiles($session_token) {

$data = xmlrpc_decode($res->getBody());
$this->assertNotEquals(false, $data);
$this->assertArrayHasKey(4, $data); // check presence of super-admin profile
$this->assertNotEquals(false, $data);
$this->assertArrayHasKey('myprofiles', $data); // check presence of root key
$this->assertArrayHasKey('id', $data['myprofiles'][0]); // check presence of id key in first entity
}


Expand Down

0 comments on commit 10558a1

Please sign in to comment.