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

CheckedOutRepositoryTest::testFromPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 11
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 function mkdir;
10
use function rmdir;
11
use function sys_get_temp_dir;
12
use function uniqid;
13
14
/**
15
 * @covers \Roave\BackwardCompatibility\Git\CheckedOutRepository
16
 */
17
final class CheckedOutRepositoryTest extends TestCase
18
{
19
    public function testFromPath() : void
20
    {
21
        $path = sys_get_temp_dir() . '/' . uniqid('testPath', true);
22
        mkdir($path, 0777, true);
23
        mkdir($path . '/.git');
24
25
        $checkedOutRepository = CheckedOutRepository::fromPath($path);
26
        self::assertSame($path, (string) $checkedOutRepository);
27
28
        rmdir($path . '/.git');
29
        rmdir($path);
30
    }
31
}
32