FilesystemTest::test()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.568
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Test;
4
5
use Basis\Filesystem;
6
use Basis\Test;
7
8
class FilesystemTest extends Test
9
{
10
    public function test()
11
    {
12
        $filesystem = $this->app->get(Filesystem::class);
13
14
        $this->assertSame($filesystem->getPath(), getcwd());
15
        $this->assertSame($filesystem->getPath(''), getcwd());
16
17
        $this->assertSame($filesystem->getPath('config'), getcwd().'/config');
18
19
        $this->assertSame(
20
            $filesystem->getPath('config', 'administrator.php'),
21
            getcwd().'/config/administrator.php'
22
        );
23
24
        $this->assertSame(
25
            $filesystem->getPath('config'.DIRECTORY_SEPARATOR.'administrator.php'),
26
            getcwd().'/config/administrator.php'
27
        );
28
29
        $this->assertTrue($filesystem->exists('php', 'BusinessLogic.php'));
30
        $this->assertFalse($filesystem->exists('php', 'InvalidLogic.php'));
31
    }
32
}
33