diff --git a/application/tests/controllers/api/Rest_test_test.php b/application/tests/controllers/api/Rest_test_test.php index f485804..d7f92e6 100644 --- a/application/tests/controllers/api/Rest_test_test.php +++ b/application/tests/controllers/api/Rest_test_test.php @@ -26,6 +26,24 @@ public function test_index_get() $this->assertResponseCode(200); } + public function test_index_get_with_get_array() + { + try { + $output = $this->request( + 'GET', 'api/rest_test', + ['name' => 'John O\'reilly', 'city' => 'Tokyo'] + ); + } catch (CIPHPUnitTestExitException $e) { + $output = ob_get_clean(); + } + + $expected = <<< 'EOL' +{"get":{"name":"John O'reilly","city":"Tokyo"},"query":{"name":"John O'reilly","city":"Tokyo"}} +EOL; + $this->assertEquals($expected, $output); + $this->assertResponseCode(200); + } + public function test_index_post() { set_is_cli(FALSE);