AuthorizationServerTraitTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 8
c 1
b 0
f 1
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRegisterAuthorizationServer() 0 12 1
1
<?php
2
3
namespace ByTIC\Hello\Tests\Oauth\ServiceProvider\Traits;
4
5
use ByTIC\Hello\HelloServiceProvider;
6
use ByTIC\Hello\Tests\AbstractTest;
7
use ByTIC\Hello\Utility\ConfigHelper;
8
use League\OAuth2\Server\AuthorizationServer;
9
use Mockery as m;
10
use Nip\Container\Container;
11
12
/**
13
 * Class AuthorizationServerTraitTest
14
 * @package ByTIC\Hello\Tests\Oauth\ServiceProvider\Traits
15
 */
16
class AuthorizationServerTraitTest extends AbstractTest
17
{
18
    public function testRegisterAuthorizationServer()
19
    {
20
        /** @var m\Mock|HelloServiceProvider $provider */
21
        $provider = \Mockery::mock(HelloServiceProvider::class)->makePartial()->shouldAllowMockingProtectedMethods();
22
        $provider->shouldReceive('createAuthorizationServer')->andReturn(\Mockery::mock(AuthorizationServer::class));
23
        $provider->shouldReceive('registerGrants');
24
25
        $container = new Container();
26
        $provider->setContainer($container);
27
        $provider->registerAuthorizationServer();
28
29
        self::assertInstanceOf(AuthorizationServer::class, $container->get('hello.server'));
30
    }
31
}
32