Remove console restrictions

This commit is contained in:
eldadfux
2019-09-15 19:50:57 +03:00
parent a5c3e978e8
commit c559379f8e
4 changed files with 52 additions and 10 deletions
+29 -1
View File
@@ -70,9 +70,37 @@ class ConsoleTest extends TestCase
'failure' => 'http://localhost/failure',
]);
var_dump();
$session = $this->client->parseCookie($response['headers']['set-cookie'])['a-session-console'];
var_dump($response['headers']);
$this->assertEquals('http://localhost/success', $response['headers']['location']);
$this->assertEquals("\n", $response['body']);
return ['session' => $session];
}
/**
* @depends testLoginSuccess
*/
public function testLogoutSuccess($data)
{
$response = $this->client->call(Client::METHOD_DELETE, '/auth/logout', [
'origin' => 'http://localhost',
'content-type' => 'application/json',
'cookie' => 'a-session-console=' . $data['session'],
], []);
var_dump($response);
$this->assertEquals('http://localhost/success', $response['headers']['location']);
$this->assertEquals("\n", $response['body']);
}
// public function testLogoutFailure()
// {
// $response = $this->client->call(Client::METHOD_DELETE, '/auth/logout', [
// 'origin' => 'http://localhost',
// 'content-type' => 'application/json',
// ], []);
// $this->assertEquals('401', $response['body']['code']);
// }
}