Passed
Pull Request — master (#50)
by Marco
02:46
created

testCheckoutAndRemove()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 14
rs 9.4285
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\GitCheckoutRevisionToTemporaryPath;
10
use Roave\BackwardCompatibility\Git\Revision;
11
use function realpath;
12
13
/**
14
 * @covers \Roave\BackwardCompatibility\Git\GitCheckoutRevisionToTemporaryPath
15
 */
16
final class GitCheckoutRevisionToTemporaryPathTest extends TestCase
17
{
18
    public function testCheckoutAndRemove() : void
19
    {
20
        $sourceRepositoryPath = realpath(__DIR__ . '/../../../');
21
22
        $git = new GitCheckoutRevisionToTemporaryPath();
23
24
        $temporaryClone = $git->checkout(
25
            CheckedOutRepository::fromPath($sourceRepositoryPath),
26
            Revision::fromSha1('428327492a803b6e0c612b157a67a50a47275461')
27
        );
28
29
        self::assertInstanceOf(CheckedOutRepository::class, $temporaryClone);
30
31
        $git->remove($temporaryClone);
32
    }
33
}
34