BootstrapTests::testBootstrapManager()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 11
nc 1
nop 0
1
<?php
2
namespace Consolidation\Bootstrap;
3
4
use Consolidation\TestUtils\TestBoot;
5
use Consolidation\TestUtils\TestBootstrapAwareObject;
6
7
class BootstrapTests extends \PHPUnit_Framework_TestCase
8
{
9
    function testBootstrapManager()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
10
    {
11
        $manager = new BootstrapManager();
12
        $testBootstrapAwareObject = new TestBootstrapAwareObject();
13
        $testBootstrapAwareObject->setBootstrapCurator($manager->getBootstrapCurator());
14
15
        $testBoot1 = new TestBoot('/path/to/boot1', '1.2.3', ['code', 'database', 'configuration']);
16
        $testBoot2 = new TestBoot('/path/to/boot2', '3.4.5', ['code', 'database', 'configuration']);
17
18
        $manager->add($testBoot1);
19
        $manager->add($testBoot2);
20
21
        $bootstrapObject = $manager->selectBootstrap('/path/to/boot1');
22
23
        $this->assertNotNull($bootstrapObject, 'Could not select a bootstrap object');
24
        $this->assertEquals('1.2.3', $testBootstrapAwareObject->getBootstrap()->getFrameworkVersion());
25
    }
26
}
27