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

DependenciesTest::testDep()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 1
nc 1
nop 0
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