test forced mapper and begin of csv test
This commit is contained in:
parent
fe4501c697
commit
0c6931f394
|
@ -132,7 +132,6 @@ class TAINACAN_REST_Exposers extends TAINACAN_UnitApiTestCase {
|
||||||
|
|
||||||
$item_exposer_json = json_encode([
|
$item_exposer_json = json_encode([
|
||||||
'exposer-type' => 'OAI-PMH',
|
'exposer-type' => 'OAI-PMH',
|
||||||
'exposer-map' => 'Dublin Core',
|
|
||||||
]);
|
]);
|
||||||
$request = new \WP_REST_Request('GET', $this->namespace . '/item/' . $item->get_id() . '/metadata' );
|
$request = new \WP_REST_Request('GET', $this->namespace . '/item/' . $item->get_id() . '/metadata' );
|
||||||
$request->set_body($item_exposer_json);
|
$request->set_body($item_exposer_json);
|
||||||
|
@ -156,7 +155,7 @@ class TAINACAN_REST_Exposers extends TAINACAN_UnitApiTestCase {
|
||||||
|
|
||||||
$item_exposer_json = json_encode([
|
$item_exposer_json = json_encode([
|
||||||
'exposer-type' => 'Html',
|
'exposer-type' => 'Html',
|
||||||
'exposer-map' => 'Value'
|
'exposer-map' => 'value'
|
||||||
]);
|
]);
|
||||||
$request = new \WP_REST_Request('GET', $this->namespace . '/item/' . $item->get_id() . '/metadata' );
|
$request = new \WP_REST_Request('GET', $this->namespace . '/item/' . $item->get_id() . '/metadata' );
|
||||||
$request->set_body($item_exposer_json);
|
$request->set_body($item_exposer_json);
|
||||||
|
@ -196,6 +195,26 @@ class TAINACAN_REST_Exposers extends TAINACAN_UnitApiTestCase {
|
||||||
$this->assertEquals('item_teste_Expose', $htmlValues[0]['Title']);
|
$this->assertEquals('item_teste_Expose', $htmlValues[0]['Title']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group exposer-type-csv
|
||||||
|
*/
|
||||||
|
public function test_csv_type() {
|
||||||
|
global $Tainacan_Fields, $Tainacan_Item_Metadata;
|
||||||
|
|
||||||
|
extract($this->create_meta_requirements());
|
||||||
|
|
||||||
|
$item_exposer_json = json_encode([
|
||||||
|
'exposer-type' => 'Csv',
|
||||||
|
]);
|
||||||
|
$request = new \WP_REST_Request('GET', $this->namespace . '/item/' . $item->get_id() . '/metadata' );
|
||||||
|
$request->set_body($item_exposer_json);
|
||||||
|
$response = $this->server->dispatch($request);
|
||||||
|
$this->assertEquals(200, $response->get_status());
|
||||||
|
//$data = $response->get_data();
|
||||||
|
|
||||||
|
//var_dump($data);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue