Skip to content
Snippets Groups Projects
Commit 00afe42c authored by Anton Bagliy's avatar Anton Bagliy
Browse files

ADD: sign in test stub #525

parent 3ccc53a6
No related merge requests found
......@@ -45,8 +45,8 @@ abstract class Controller_Handler_Api extends Controller
// If the action doesn't exist, it's a 404
if (!method_exists($this, $action)) {
throw HTTP_API_Exception::factory(404,
'The requested URL :uri was not found on this server.',
[':uri' => $this->request->uri()]
'The requested URL :uri with :action was not found on this server.',
[':uri' => $this->request->uri(), ':action' => $this->request->action()]
)->request($this->request);
}
......
<?php
/**
* Sign in, check that authorized
* @group handler
* @group valid
* @group auth
*/
class Controller_Handler_Sign_In_Test extends PHPUnit_Framework_TestCase
{
protected function setUp()
{
//Kohana::config('database')->default = Kohana::config('database')
// ->unit_testing;
}
private function getRequestTemplate()
{
$request = new Request('/handler/sign/in');
$request->body('{
"login": "rs",
"password": "11111"
}'
);
$request->method('GET');
$request->cookie('XDEBUG_SESSION', 'XDEBUG_ECLIPSE');
return $request;
}
/** @test */
public function signInLocal()
{
$request = $this->getRequestTemplate();
$response = $request->execute();
$this->assertEquals(200, $response->status());
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment