@@ 94-103 (lines=10) @@ | ||
91 | $this->assertTrue($supportsToken); |
|
92 | } |
|
93 | ||
94 | public function testAuthenticateTokenInvalidArgumentException() |
|
95 | { |
|
96 | $this->expectException(\InvalidArgumentException::class); |
|
97 | ||
98 | $token = new PreAuthenticatedToken('user', 'credentials', 'abcd'); |
|
99 | $userProvider = $this->getMockBuilder(UserProviderInterface::class)->getMock(); |
|
100 | ||
101 | $simplePreAuthenticator = new SimplePreAuthenticator('keyName', 'header'); |
|
102 | $simplePreAuthenticator->authenticateToken($token, $userProvider, 'oslab'); |
|
103 | } |
|
104 | ||
105 | public function testAuthenticateTokenUsernameNotFoundException() |
|
106 | { |
|
@@ 105-114 (lines=10) @@ | ||
102 | $simplePreAuthenticator->authenticateToken($token, $userProvider, 'oslab'); |
|
103 | } |
|
104 | ||
105 | public function testAuthenticateTokenUsernameNotFoundException() |
|
106 | { |
|
107 | $this->expectException(UsernameNotFoundException::class); |
|
108 | ||
109 | $token = new PreAuthenticatedToken('user', 'credentials', 'abcd'); |
|
110 | $userProvider = new InMemoryApiUserProvider(); |
|
111 | ||
112 | $simplePreAuthenticator = new SimplePreAuthenticator('keyName', 'header'); |
|
113 | $simplePreAuthenticator->authenticateToken($token, $userProvider, 'oslab'); |
|
114 | } |
|
115 | ||
116 | public function testAuthenticateToken() |
|
117 | { |