MakeThemeTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateExistingTheme() 0 9 1
A testCreateTheme() 0 10 1
1
<?php
2
3
namespace Maestriam\Samurai\Tests\Unit\Entities\Theme;
4
5
use Maestriam\Samurai\Entities\Theme;
6
use Maestriam\Samurai\Exceptions\ThemeExistsException;
7
8
/**
9
 * Testes de funcionalidades básicas apresentadas no README.md
10
 */
11
class MakeThemeTest extends ThemeTestCase
12
{
13
    /**
14
     * Verifica se consegue criar um tema com um vendor válido
15
     *
16
     * @return void
17
     */
18
    public function testCreateTheme()
19
    {
20
        $theme = new Theme('bands/ozzy');
21
22
        $theme = $theme->make();
23
24
        $this->assertInstanceOf(Theme::class, $theme);
25
        $this->assertDirectoryExists($theme->paths()->root());
26
        $this->assertDirectoryExists($theme->paths()->source());   
27
        $this->assertDirectoryExists($theme->paths()->assets()); 
28
    } 
29
    
30
    /**
31
     * Verifica se consegue criar um tema já existe na base
32
     *
33
     * @return void
34
     */
35
    public function testCreateExistingTheme()
36
    {
37
        $theme1 = new Theme('bands/ozzy');
38
        $theme2 = new Theme('bands/ozzy');
39
40
        $this->expectException(ThemeExistsException::class);
41
42
        $theme1->make();
43
        $theme2->make();
44
    }
45
}