| @@ 38-48 (lines=11) @@ | ||
| 35 | $this->requestStack = $this->createMock(RequestStack::class); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function testHasTokenForHttp() |
|
| 39 | { |
|
| 40 | $csrfTokenManager = $this->createCsrfTokenManager(false); |
|
| 41 | ||
| 42 | $this->tokenStorage |
|
| 43 | ->expects($this->once()) |
|
| 44 | ->method('hasToken') |
|
| 45 | ->with(self::CSRF_TOKEN_INTENTION); |
|
| 46 | ||
| 47 | $csrfTokenManager->hasToken(self::CSRF_TOKEN_INTENTION); |
|
| 48 | } |
|
| 49 | ||
| 50 | public function testHasTokenForHttps() |
|
| 51 | { |
|
| @@ 50-60 (lines=11) @@ | ||
| 47 | $csrfTokenManager->hasToken(self::CSRF_TOKEN_INTENTION); |
|
| 48 | } |
|
| 49 | ||
| 50 | public function testHasTokenForHttps() |
|
| 51 | { |
|
| 52 | $csrfTokenManager = $this->createCsrfTokenManager(true); |
|
| 53 | ||
| 54 | $this->tokenStorage |
|
| 55 | ->expects($this->once()) |
|
| 56 | ->method('hasToken') |
|
| 57 | ->with('https-' . self::CSRF_TOKEN_INTENTION); |
|
| 58 | ||
| 59 | $csrfTokenManager->hasToken(self::CSRF_TOKEN_INTENTION); |
|
| 60 | } |
|
| 61 | ||
| 62 | private function createCsrfTokenManager($https = false) |
|
| 63 | { |
|