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

FilesystemTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A test() 0 22 1
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