ThemeStructureTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 40
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testSourcePath() 0 5 1
A testPublicPath() 0 5 1
A testAssetPath() 0 5 1
A assertPathString() 0 12 1
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
}