GitParseRevisionTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A revisionProvider() 0 4 1
A testFromStringForRepository() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace RoaveTest\BackwardCompatibility\Git;
6
7
use PHPUnit\Framework\TestCase;
8
use Roave\BackwardCompatibility\Git\CheckedOutRepository;
9
use Roave\BackwardCompatibility\Git\GitParseRevision;
10
11
/**
12
 * @covers \Roave\BackwardCompatibility\Git\GitParseRevision
13
 */
14
final class GitParseRevisionTest extends TestCase
15
{
16
    /**
17
     * @return string[][]
18
     */
19
    public function revisionProvider() : array
20
    {
21
        return [
22
            ['e72a47b', 'e72a47bb9d777c9e73c1322d58a83450d36d9454'],
23
        ];
24
    }
25
26
    /**
27
     * @dataProvider revisionProvider
28
     */
29
    public function testFromStringForRepository(string $revisionToBeParsed, string $expectedRevision) : void
30
    {
31
        self::assertSame(
32
            $expectedRevision,
33
            (new GitParseRevision())->fromStringForRepository(
34
                $revisionToBeParsed,
35
                CheckedOutRepository::fromPath(__DIR__ . '/../../../')
36
            )->__toString()
37
        );
38
    }
39
}
40