Passed
Push — master ( 3eb4db...99d5ff )
by Kirill
03:12
created

DependenciesTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 11
c 1
b 0
f 0
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testDep2() 0 10 1
A testDep() 0 10 1
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Boot;
13
14
use PHPUnit\Framework\TestCase;
15
use Spiral\Boot\BootloadManager;
16
use Spiral\Tests\Boot\Fixtures\BootloaderA;
17
use Spiral\Tests\Boot\Fixtures\BootloaderB;
18
use Spiral\Core\Container;
19
20
class DependenciesTest extends TestCase
21
{
22
    public function testDep(): void
23
    {
24
        $c = new Container();
25
26
        $b = new BootloadManager($c);
27
28
        $b->bootload([BootloaderA::class]);
29
30
        $this->assertTrue($c->has('a'));
31
        $this->assertFalse($c->has('b'));
32
    }
33
34
    public function testDep2(): void
35
    {
36
        $c = new Container();
37
38
        $b = new BootloadManager($c);
39
40
        $b->bootload([BootloaderB::class]);
41
42
        $this->assertTrue($c->has('a'));
43
        $this->assertTrue($c->has('b'));
44
    }
45
}
46