OAuth2ServiceProviderTest::setup()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
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\Test\Unit
10
{
11
    use \Codeception\Specify;
12
13
    /**
14
     * @var MockApplication
15
     */
16
    protected $app;
17
18
    /**
19
     * @inheritdoc
20
     */
21
    protected function setup()
22
    {
23
        $this->app = new MockApplication();
24
        $this->app->withFacades();
25
        $this->app->register(MockStorageServiceProvider::class);
26
        $this->app->register(OAuth2ServiceProvider::class);
27
    }
28
29
    /**
30
     *
31
     */
32
    public function testAssertCanBeRegistered()
33
    {
34
        $this->specify('verify serviceProvider is registered', function () {
35
            $service = $this->app->make(OAuth2Service::class);
36
            verify($service)->isInstanceOf(OAuth2Service::class);
37
        });
38
    }
39
40
    /**
41
     *
42
     */
43
    public function testAssertFacade()
44
    {
45
        $this->specify('verify serviceProvider facade', function () {
46
            verify(OAuth2Facade::getFacadeRoot())->isInstanceOf(OAuth2Service::class);
47
        });
48
    }
49
}
50