Passed
Push — master ( ed297f...604ea4 )
by Giuliano
04:39
created

GetThemeBaseTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 39
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetBasePath() 0 9 1
A testGetDefaultBasePath() 0 9 1
1
<?php
2
3
namespace Maestriam\Samurai\Tests\Unit\Foundation\ConfigKeeper;
4
5
use Maestriam\FileSystem\Support\FileSystem;
6
use Maestriam\Samurai\Foundation\ConfigKeeper;
7
8
/**
9
 * Testes de funcionalidades básicas apresentadas no README.md
10
 */
11
class GetThemeBaseTest extends ConfigKeeperTestCase
12
{
13
    /**
14
     * Verifica se consegue recuperar o caminho do diretório-base 
15
     * de temas do projeto.  
16
     * 
17
     * Este caminho é definido no arquivo config.php.
18
     *
19
     * @return void
20
     */
21
    public function testGetBasePath()
22
    {          
23
        $config = $this->getConfigKeeper();
24
        $folder = base_path('bands/kiss') . DS;
25
        $folder = FileSystem::folder($folder)->sanitize();
26
27
        $this->setThemeBase($folder);
28
29
        $this->assertConfigKey($config->base(), $folder);
30
    }
31
32
    /**
33
     * Verifica se consegue recuperar o caminho padrão do 
34
     * diretório-base de temas do projeto.  
35
     * 
36
     * Este caminho é definido via código na ausência de configuração 
37
     * no config.php
38
     * 
39
     * @return void
40
     */
41
    public function testGetDefaultBasePath()
42
    {        
43
        $this->setThemeBase(null);
44
45
        $config = $this->getConfigKeeper();
46
        $default = base_path('themes') . DS;
47
        $default = FileSystem::folder($default)->sanitize();        
48
49
        $this->assertConfigKey($config->base(), $default);
50
    }
51
}