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

CheckedOutRepositoryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFromPath() 0 11 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 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