testFromStringForRepository()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
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