better handler response errors

This commit is contained in:
Jacson Passold 2018-01-29 18:18:40 -02:00
parent 8f439e7557
commit a9bcd0292a
4 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ class TAINACAN_REST_Collections_Controller extends TAINACAN_UnitApiTestCase {
$request->set_body($collection_JSON);
$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();
$id = $collection['id'];

View File

@ -44,7 +44,7 @@ class TAINACAN_REST_Terms_Controller extends TAINACAN_UnitApiTestCase {
$response = $this->server->dispatch($request);
$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('Filter name', $data['name']);
}

View File

@ -41,7 +41,7 @@ class TAINACAN_REST_Metadata_Controller extends TAINACAN_UnitApiTestCase {
$response = $this->server->dispatch($request);
$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']);
}

View File

@ -65,7 +65,7 @@ class TAINACAN_REST_Taxonomies_Controller extends TAINACAN_UnitApiTestCase {
$response = $this->server->dispatch($request);
$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']);
}