ThemeStructureTest::assertPathString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 12
rs 9.9666
1
<?php
2
3
namespace Maestriam\Samurai\Tests\Unit\Entities\Theme;
4
5
use Maestriam\Samurai\Entities\Theme;
6
7
class ThemeStructureTest extends ThemeTestCase
8
{
9
    /**
10
     * Verifica se retorna o 
11
     *
12
     * @return void
13
     */
14
    public function testSourcePath()
15
    {
16
        $theme = new Theme('sandbox/local');
17
18
        $this->assertPathString($theme->paths()->source());
19
    }    
20
    
21
    public function testAssetPath()
22
    {
23
        $theme = new Theme('sandbox/local');
24
        
25
        $this->assertPathString($theme->paths()->assets());
26
    }
27
    
28
    public function testPublicPath()
29
    {
30
        $theme = new Theme('sandbox/local');        
31
        
32
        $this->assertPathString($theme->paths()->public());
33
    }
34
    
35
    private function assertPathString(string $path)
36
    {
37
        $dbSlashes = '//';
38
        $dbInvSlashes = '\\\\';
39
        $dbCrossSlashes = '\/';
40
        $dbInvCrossSlashes = '/\\';
41
42
        $this->assertIsString($path);
43
        $this->assertStringNotContainsString($dbSlashes, $path);
44
        $this->assertStringNotContainsString($dbInvSlashes, $path);
45
        $this->assertStringNotContainsString($dbCrossSlashes, $path);
46
        $this->assertStringNotContainsString($dbInvCrossSlashes, $path);
47
    }
48
}