Completed
Pull Request — master (#1)
by Greg
02:18
created

BootstrapTests   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 20
wmc 1
lcom 0
cbo 4
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testBootstrapManager() 0 17 1
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