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

OAuth2ServiceProviderTest::setup()   A

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
c 0
b 0
f 0
rs 9.4285
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\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