Completed
Push — master ( d83206...aa4419 )
by Marco
10s
created

GitParseRevisionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
c 0
b 0
f 0
rs 10
wmc 2

2 Methods

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