From caa5f9aec44e4fc8773ff6fa7676f62b666406de Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Wed, 5 Sep 2018 19:23:39 +0200 Subject: [PATCH] Optimized Tests for user controller --- .../tests/unit/Controller/UserControllerTest.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/application/tests/unit/Controller/UserControllerTest.php b/application/tests/unit/Controller/UserControllerTest.php index f238713..2aea794 100644 --- a/application/tests/unit/Controller/UserControllerTest.php +++ b/application/tests/unit/Controller/UserControllerTest.php @@ -24,17 +24,23 @@ class UserControllerTest extends TestCase public function testLogout(): void { - $this->assertEquals(true, $this->userController->logout()->isSuccessful()); + $client = static::createClient(); + $client->request('GET', '/user/logout'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); } public function testLogin(): void { - $this->assertEquals(true, $this->userController->login()->isSuccessful()); + $client = static::createClient(); + $client->request('GET', '/user/login'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); } public function testRegister():void { - $this->assertEquals(true, $this->userController->register()->isSuccessful()); + $client = static::createClient(); + $client->request('GET', '/user/register'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); } }