Completed
Push — develop ( 6fd965...1bc1b2 )
by Christoffer
02:13
created

OAuth2ServiceProviderTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
dl 0
loc 46
c 0
b 0
f 0
wmc 3
lcom 1
cbo 5
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setup() 0 7 1
A testAssertCanBeRegistered() 0 7 1
A testAssertFacade() 0 6 1
1
<?php
2
3
namespace Nord\Lumen\OAuth2\Tests;
4
5
use Nord\Lumen\OAuth2\OAuth2Facade;
6
use Nord\Lumen\OAuth2\OAuth2Service;
7
use Nord\Lumen\OAuth2\OAuth2ServiceProvider;
8
9
class OAuth2ServiceProviderTest extends \Codeception\TestCase\Test
10
{
11
    use \Codeception\Specify;
12
13
    /**
14
     * @var \UnitTester
15
     */
16
    protected $tester;
17
18
    /**
19
     * @var MockApplication
20
     */
21
    protected $app;
22
23
    /**
24
     * @inheritdoc
25
     */
26
    protected function setup()
27
    {
28
        $this->app = new MockApplication();
29
        $this->app->withFacades();
30
        $this->app->register(MockStorageServiceProvider::class);
31
        $this->app->register(OAuth2ServiceProvider::class);
32
    }
33
34
    /**
35
     *
36
     */
37
    public function testAssertCanBeRegistered()
38
    {
39
        $this->specify('verify serviceProvider is registered', function () {
40
            $service = $this->app->make(OAuth2Service::class);
41
            verify($service)->isInstanceOf(OAuth2Service::class);
42
        });
43
    }
44
45
    /**
46
     *
47
     */
48
    public function testAssertFacade()
49
    {
50
        $this->specify('verify serviceProvider facade', function () {
51
            verify(OAuth2Facade::getFacadeRoot())->isInstanceOf(OAuth2Service::class);
52
        });
53
    }
54
}
55