better handler response errors
This commit is contained in:
parent
8f439e7557
commit
a9bcd0292a
|
@ -39,7 +39,7 @@ class TAINACAN_REST_Collections_Controller extends TAINACAN_UnitApiTestCase {
|
||||||
$request->set_body($collection_JSON);
|
$request->set_body($collection_JSON);
|
||||||
|
|
||||||
$response = $this->server->dispatch( $request );
|
$response = $this->server->dispatch( $request );
|
||||||
$this->assertEquals( 201, $response->get_status() );
|
$this->assertEquals( 201, $response->get_status(), sprintf('response: %s', print_r($response, true)) );
|
||||||
|
|
||||||
$collection = $response->get_data();
|
$collection = $response->get_data();
|
||||||
$id = $collection['id'];
|
$id = $collection['id'];
|
||||||
|
|
|
@ -44,7 +44,7 @@ class TAINACAN_REST_Terms_Controller extends TAINACAN_UnitApiTestCase {
|
||||||
$response = $this->server->dispatch($request);
|
$response = $this->server->dispatch($request);
|
||||||
|
|
||||||
$data = $response->get_data();
|
$data = $response->get_data();
|
||||||
|
$this->assertTrue(is_array($data) && array_key_exists('filter_type', $data), sprintf('cannot create a range, response: %s', print_r($data, true)));
|
||||||
$this->assertEquals('Tainacan\Filter_Types\Range', $data['filter_type']);
|
$this->assertEquals('Tainacan\Filter_Types\Range', $data['filter_type']);
|
||||||
$this->assertEquals('Filter name', $data['name']);
|
$this->assertEquals('Filter name', $data['name']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ class TAINACAN_REST_Metadata_Controller extends TAINACAN_UnitApiTestCase {
|
||||||
$response = $this->server->dispatch($request);
|
$response = $this->server->dispatch($request);
|
||||||
|
|
||||||
$metadata_added = $response->get_data();
|
$metadata_added = $response->get_data();
|
||||||
|
$this->assertTrue(is_array($metadata_added) && array_key_exists('name', $metadata_added), sprintf('cannot create metadata, response: %s', print_r($metadata_added, true)));
|
||||||
$this->assertEquals('Moeda', $metadata_added['name']);
|
$this->assertEquals('Moeda', $metadata_added['name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ class TAINACAN_REST_Taxonomies_Controller extends TAINACAN_UnitApiTestCase {
|
||||||
$response = $this->server->dispatch($request);
|
$response = $this->server->dispatch($request);
|
||||||
|
|
||||||
$data = $response->get_data();
|
$data = $response->get_data();
|
||||||
|
$this->assertTrue(is_array($data) && array_key_exists('name', $data), sprintf('cannot create a range, response: %s', print_r($data, true)));
|
||||||
$this->assertEquals('Nome', $data['name']);
|
$this->assertEquals('Nome', $data['name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue