| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 19 | public function testMakeGrantPersonalAccess() |
||
| 20 | { |
||
| 21 | $container = new Container(); |
||
| 22 | |||
| 23 | /** @var Mockery\Mock|HelloServiceProvider $provider */ |
||
| 24 | $provider = \Mockery::mock(HelloServiceProvider::class) |
||
| 25 | ->makePartial()->shouldAllowMockingProtectedMethods(); |
||
| 26 | |||
| 27 | $provider->shouldReceive('getRegisteredGrants') |
||
| 28 | ->andReturn(['PersonalAccess' => PersonalAccessGrant::class]); |
||
| 29 | |||
| 30 | $provider->shouldReceive('createAuthorizationServer')->andReturn(\Mockery::mock(AuthorizationServer::class)); |
||
| 31 | |||
| 32 | $provider->shouldReceive('makeCryptKey') |
||
| 33 | ->andReturn(new CryptKey("-----BEGIN RSA PRIVATE KEY-----\nconfig\n-----END RSA PRIVATE KEY-----", null, false)); |
||
| 34 | |||
| 35 | $provider->shouldReceive('makeGrantPersonalAccess')->once(); |
||
| 36 | |||
| 37 | $provider->setContainer($container); |
||
| 38 | $provider->registerAuthorizationServer(); |
||
| 39 | |||
| 40 | $server = $container->get('hello.server'); |
||
| 41 | self::assertInstanceOf(AuthorizationServer::class, $server); |
||
| 42 | } |
||
| 44 |