From 8bdff539f89999aa6d2d86d8eb3340a44312895c Mon Sep 17 00:00:00 2001 From: Jacson Passold Date: Wed, 4 Apr 2018 01:40:17 -0300 Subject: [PATCH] begin html test --- tests/test-api-exposers.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test-api-exposers.php b/tests/test-api-exposers.php index dcae31f58..19666f49d 100644 --- a/tests/test-api-exposers.php +++ b/tests/test-api-exposers.php @@ -145,6 +145,27 @@ class TAINACAN_REST_Exposers extends TAINACAN_UnitApiTestCase { $this->assertEquals('adasdasdsa', $dc->description); $this->assertEquals('item_teste_Expose', $dc->title); } + + /** + * @group exposer-type-html + */ + public function test_html_type() { + global $Tainacan_Fields, $Tainacan_Item_Metadata; + + extract($this->create_meta_requirements()); + + $item_exposer_json = json_encode([ + 'exposer-type' => 'Html', + ]); + $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); + } + } ?> \ No newline at end of file