diff --git a/tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php b/tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php deleted file mode 100644 index 8b7c6342e..000000000 --- a/tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php +++ /dev/null @@ -1,56 +0,0 @@ -authManager = m::mock(AuthManager::class); - } - - /** - * Test that an authenticated user is redirected. - */ - public function testAuthenticatedUserIsRedirected(): void - { - $this->authManager->shouldReceive('guard')->with(null)->once()->andReturnSelf(); - $this->authManager->shouldReceive('check')->withNoArgs()->once()->andReturn(true); - - $response = $this->getMiddleware()->handle($this->request, $this->getClosureAssertions()); - $this->assertInstanceOf(RedirectResponse::class, $response); - $this->assertEquals(route('index'), $response->getTargetUrl()); - } - - /** - * Test that a non-authenticated user continues through the middleware. - */ - public function testNonAuthenticatedUserIsNotRedirected(): void - { - $this->authManager->shouldReceive('guard')->with(null)->once()->andReturnSelf(); - $this->authManager->shouldReceive('check')->withNoArgs()->once()->andReturn(false); - - $this->getMiddleware()->handle($this->request, $this->getClosureAssertions()); - } - - /** - * Return an instance of the middleware using mocked dependencies. - */ - private function getMiddleware(): RedirectIfAuthenticated - { - return new RedirectIfAuthenticated($this->authManager); - } -}