|
13 | 13 | use League\OAuth2\Client\Provider\Exception\AppleAccessDeniedException;
|
14 | 14 | use League\OAuth2\Client\Token\AccessToken;
|
15 | 15 | use League\OAuth2\Client\Tool\QueryBuilderTrait;
|
| 16 | +use PHPUnit\Framework\TestCase; |
16 | 17 | use Mockery as m;
|
17 | 18 |
|
18 |
| -class AppleTest extends \PHPUnit_Framework_TestCase |
| 19 | +class AppleTest extends TestCase |
19 | 20 | {
|
20 | 21 | use QueryBuilderTrait;
|
21 | 22 |
|
@@ -143,12 +144,13 @@ public function testGetAccessToken()
|
143 | 144 | ]);
|
144 | 145 | $provider = m::mock($provider);
|
145 | 146 |
|
146 |
| - $time = new \DateTimeImmutable(); |
| 147 | + $time = new \DateTimeImmutable(); |
| 148 | + $expiresAt = $time->modify('+1 Hour'); |
147 | 149 | $token = (new Builder())
|
148 | 150 | ->issuedBy('test-team-id')
|
149 | 151 | ->permittedFor('https://appleid.apple.com')
|
150 |
| - ->issuedAt($time) |
151 |
| - ->expiresAt((clone $time)->modify('+1 Hour')) |
| 152 | + ->issuedAt($time->getTimestamp()) |
| 153 | + ->expiresAt($expiresAt->getTimestamp()) |
152 | 154 | ->relatedTo('test-client')
|
153 | 155 | ->withClaim('sub', 'test')
|
154 | 156 | ->withHeader('alg', 'RS256')
|
@@ -213,10 +215,11 @@ public function testNotImplementedGetResourceOwnerDetailsUrl()
|
213 | 215 | $this->provider->getResourceOwnerDetailsUrl(new AccessToken(['access_token' => 'hello']));
|
214 | 216 | }
|
215 | 217 |
|
| 218 | + /** |
| 219 | + * @expectedException \League\OAuth2\Client\Provider\Exception\AppleAccessDeniedException |
| 220 | + */ |
216 | 221 | public function testCheckResponse()
|
217 | 222 | {
|
218 |
| - $this->setExpectedException(AppleAccessDeniedException::class, 'invalid_client', 400); |
219 |
| - |
220 | 223 | $class = new \ReflectionClass($this->provider);
|
221 | 224 | $method = $class->getMethod('checkResponse');
|
222 | 225 | $method->setAccessible(true);
|
|
0 commit comments