| @@ 70-89 (lines=20) @@ | ||
| 67 | $this->assertSame(200, $response->getStatusCode()); |
|
| 68 | } |
|
| 69 | ||
| 70 | public function testExecuteWithNoAuth(): void |
|
| 71 | { |
|
| 72 | $this->sessionManager->isAuthenticated() |
|
| 73 | ->willReturn(true) |
|
| 74 | ; |
|
| 75 | ||
| 76 | $this->router->generate('core23_facebook_success', [], UrlGeneratorInterface::ABSOLUTE_PATH) |
|
| 77 | ->willReturn('/success') |
|
| 78 | ->shouldBeCalled() |
|
| 79 | ; |
|
| 80 | ||
| 81 | $action = new AuthErrorAction( |
|
| 82 | $this->twig->reveal(), |
|
| 83 | $this->router->reveal(), |
|
| 84 | $this->sessionManager->reveal(), |
|
| 85 | $this->eventDispatcher->reveal() |
|
| 86 | ); |
|
| 87 | ||
| 88 | $this->assertInstanceOf(RedirectResponse::class, $action()); |
|
| 89 | } |
|
| 90 | } |
|
| 91 | ||
| @@ 78-97 (lines=20) @@ | ||
| 75 | $this->assertSame(200, $response->getStatusCode()); |
|
| 76 | } |
|
| 77 | ||
| 78 | public function testExecuteNoAuth(): void |
|
| 79 | { |
|
| 80 | $this->sessionManager->isAuthenticated() |
|
| 81 | ->willReturn(false) |
|
| 82 | ; |
|
| 83 | ||
| 84 | $this->router->generate('core23_facebook_error', [], UrlGeneratorInterface::ABSOLUTE_PATH) |
|
| 85 | ->willReturn('/success') |
|
| 86 | ->shouldBeCalled() |
|
| 87 | ; |
|
| 88 | ||
| 89 | $action = new AuthSuccessAction( |
|
| 90 | $this->twig->reveal(), |
|
| 91 | $this->router->reveal(), |
|
| 92 | $this->sessionManager->reveal(), |
|
| 93 | $this->eventDispatcher->reveal() |
|
| 94 | ); |
|
| 95 | ||
| 96 | $this->assertInstanceOf(RedirectResponse::class, $action()); |
|
| 97 | } |
|
| 98 | ||
| 99 | public function testExecuteNoSession(): void |
|
| 100 | { |
|
| @@ 99-121 (lines=23) @@ | ||
| 96 | $this->assertInstanceOf(RedirectResponse::class, $action()); |
|
| 97 | } |
|
| 98 | ||
| 99 | public function testExecuteNoSession(): void |
|
| 100 | { |
|
| 101 | $this->sessionManager->isAuthenticated() |
|
| 102 | ->willReturn(true) |
|
| 103 | ; |
|
| 104 | $this->sessionManager->getSession() |
|
| 105 | ->willReturn(null) |
|
| 106 | ; |
|
| 107 | ||
| 108 | $this->router->generate('core23_facebook_error', [], UrlGeneratorInterface::ABSOLUTE_PATH) |
|
| 109 | ->willReturn('/success') |
|
| 110 | ->shouldBeCalled() |
|
| 111 | ; |
|
| 112 | ||
| 113 | $action = new AuthSuccessAction( |
|
| 114 | $this->twig->reveal(), |
|
| 115 | $this->router->reveal(), |
|
| 116 | $this->sessionManager->reveal(), |
|
| 117 | $this->eventDispatcher->reveal() |
|
| 118 | ); |
|
| 119 | ||
| 120 | $this->assertInstanceOf(RedirectResponse::class, $action()); |
|
| 121 | } |
|
| 122 | } |
|
| 123 | ||