Completed
Push — master ( 89c293...abdd73 )
by Greg
7s
created

BootstrapTests::testBootstrapManager()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 17
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->setBootstrapCurrator($manager->getBootstrapCurrator());
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