From 6ed891fc0416e8025f929cf60a07b1020118b221 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Thu, 25 Oct 2018 18:53:05 +0200 Subject: Added logout via AuthController --- tests/Unit/Controllers/AuthControllerTest.php | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tests/Unit/Controllers/AuthControllerTest.php (limited to 'tests/Unit/Controllers/AuthControllerTest.php') diff --git a/tests/Unit/Controllers/AuthControllerTest.php b/tests/Unit/Controllers/AuthControllerTest.php new file mode 100644 index 00000000..c5349cda --- /dev/null +++ b/tests/Unit/Controllers/AuthControllerTest.php @@ -0,0 +1,42 @@ +createMock(Response::class); + /** @var SessionInterface|MockObject $session */ + $session = $this->getMockForAbstractClass(SessionInterface::class); + /** @var UrlGeneratorInterface|MockObject $url */ + $url = $this->getMockForAbstractClass(UrlGeneratorInterface::class); + + $session->expects($this->once()) + ->method('invalidate'); + + $response->expects($this->once()) + ->method('redirectTo') + ->with('https://foo.bar/'); + + $url->expects($this->once()) + ->method('to') + ->with('/') + ->willReturn('https://foo.bar/'); + + $controller = new AuthController($response, $session, $url); + $controller->logout(); + } +} -- cgit v1.2.3-54-g00ecf