Completed
Push — master ( bff253...2705ab )
by Dmitry
05:49 queued 01:23
created

FilesystemTest::test()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

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