FractalServiceProviderTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setup() 0 6 1
A testAssertCanBeRegistered() 0 7 1
A testAssertFacade() 0 6 1
1
<?php
2
3
namespace Nord\Lumen\Fractal\Tests;
4
5
use Nord\Lumen\Fractal\FractalFacade;
6
use Nord\Lumen\Fractal\FractalService;
7
use Nord\Lumen\Fractal\FractalServiceProvider;
8
9
class FractalServiceProviderTest 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(FractalServiceProvider::class);
26
    }
27
28
    /**
29
     *
30
     */
31
    public function testAssertCanBeRegistered()
32
    {
33
        $this->specify('verify serviceProvider is registered', function () {
34
            $service = $this->app->make(FractalService::class);
35
            verify($service)->isInstanceOf(FractalService::class);
36
        });
37
    }
38
39
    /**
40
     *
41
     */
42
    public function testAssertFacade()
43
    {
44
        $this->specify('verify serviceProvider facade', function () {
45
            verify(FractalFacade::getFacadeRoot())->isInstanceOf(FractalService::class);
46
        });
47
    }
48
}
49