Passed
Branch master (6a8d47)
by Brice
03:48
created

SourceTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testBuildFromArray() 0 13 1
1
<?php
2
3
namespace CompoLab\Tests\Domain;
4
5
use CompoLab\Domain\Source;
6
use PHPUnit\Framework\TestCase;
7
8
final class SourceTest extends TestCase
9
{
10
    public function testBuildFromArray()
11
    {
12
        $source = Source::buildFromArray([
13
            'type'      => 'git',
14
            'url'       => '[email protected]:vendor/project.git',
15
            'reference' => '6a6e0ea9479c821d4b5728c0d3c9840e71085e82',
16
        ]);
17
18
        $sourceArray = $source->_toArray();
19
20
        $this->assertEquals('git', $sourceArray['type']);
21
        $this->assertEquals('[email protected]:vendor/project.git', $sourceArray['url']);
22
        $this->assertEquals('6a6e0ea9479c821d4b5728c0d3c9840e71085e82', $sourceArray['reference']);
23
    }
24
}
25