fix the tests cases. #90

This commit is contained in:
vnmedeiros 2019-02-22 14:26:45 -03:00
parent 4b364319a5
commit c7488760d5
3 changed files with 8 additions and 8 deletions

View File

@ -71,7 +71,7 @@ class TAINACAN_REST_Items_Controller extends TAINACAN_UnitApiTestCase {
$response = $this->server->dispatch($request);
$this->assertEquals(200, $response->get_status());
$data = $response->get_data();
$data = $response->get_data()['items'];
$items_titles = [$data[0]['title'], $data[1]['title']];
@ -248,7 +248,7 @@ class TAINACAN_REST_Items_Controller extends TAINACAN_UnitApiTestCase {
$response = $this->server->dispatch($request);
$data = $response->get_data();
$data = $response->get_data()['items'];
$this->assertCount(1, $data);
$this->assertEquals('SCRUM', $data[0]['title']);
@ -366,7 +366,7 @@ class TAINACAN_REST_Items_Controller extends TAINACAN_UnitApiTestCase {
'GET', $this->namespace . '/items'
);
$response = $this->server->dispatch($request);
$data = $response->get_data();
$data = $response->get_data()['items'];
$this->assertEquals( 2, sizeof($data) );
$this->assertEquals( 5, sizeof($data[0]['metadata']) );
@ -377,7 +377,7 @@ class TAINACAN_REST_Items_Controller extends TAINACAN_UnitApiTestCase {
);
$request->set_query_params($attributes);
$response = $this->server->dispatch($request);
$data = $response->get_data();
$data = $response->get_data()['items'];
$this->assertEquals( 2, sizeof($data) );
@ -395,7 +395,7 @@ class TAINACAN_REST_Items_Controller extends TAINACAN_UnitApiTestCase {
);
$request->set_query_params($attributes);
$response = $this->server->dispatch($request);
$data = $response->get_data();
$data = $response->get_data()['items'];
$this->assertEquals( 2, sizeof($data) );
$this->assertEquals( 1, sizeof($data[0]['metadata']) );

View File

@ -262,7 +262,7 @@ class TAINACAN_REST_Metadatum_Mappers_Controller extends TAINACAN_UnitApiTestCas
]));
$response = $this->server->dispatch($item_request);
$this->assertEquals(200, $response->get_status());
$data = $response->get_data();
$data = $response->get_data()['items'];
$this->assertEquals(1, sizeof($data), 'Response should contain 1 item');

View File

@ -216,7 +216,7 @@ class TAINACAN_REST_Queries extends TAINACAN_UnitApiTestCase {
$meta_query_request->set_query_params($meta_query);
$meta_query_response = $this->server->dispatch($meta_query_request);
$data3 = $meta_query_response->get_data();
$data3 = $meta_query_response->get_data()['items'];
$this->assertCount(2, $data3);
@ -290,7 +290,7 @@ class TAINACAN_REST_Queries extends TAINACAN_UnitApiTestCase {
$tax_query_request_collections->set_query_params($tax_query);
$tax_query_response_collections = $this->server->dispatch($tax_query_request_collections);
$data6 = $tax_query_response_collections->get_data();
$data6 = $tax_query_response_collections->get_data()['items'];
$this->assertCount(2, $data6);