ChronosServiceProviderTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
c 0
b 0
f 0
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 8 1
A testRegister() 0 5 1
1
<?php
2
3
namespace Cino\LaravelChronos\Tests;
4
5
use ArrayAccess;
6
use Cake\Chronos\ChronosInterface;
7
use Cino\LaravelChronos\ChronosServiceProvider;
8
use Illuminate\Contracts\Foundation\Application as ApplicationInterface;
9
use Illuminate\Support\Facades\Date;
10
use Mockery;
11
use PHPUnit\Framework\TestCase;
12
13
class ChronosServiceProviderTest extends TestCase
14
{
15
    /**
16
     * @var \ArrayAccess|\Mockery\LegacyMockInterface|\Mockery\MockInterface
17
     */
18
    protected $app;
19
20
    /**
21
     * @var \Cino\LaravelChronos\ChronosServiceProvider
22
     */
23
    protected $provider;
24
25
    public function setUp(): void
26
    {
27
        $this->app = Mockery::mock(ArrayAccess::class);
28
29
        /** @var ApplicationInterface $app */
30
        $app = $this->app;
31
32
        $this->provider = new ChronosServiceProvider($app);
33
    }
34
35
    public function testRegister(): void
36
    {
37
        $this->provider->register();
38
39
        $this->assertInstanceOf(ChronosInterface::class, Date::now());
40
    }
41
}
42