ThemeVendorTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A assertThemeVendor() 0 4 1
A testSetVendor() 0 5 1
A testGetVendorPackage() 0 7 1
1
<?php
2
3
namespace Maestriam\Samurai\Tests\Unit\Entities\Theme;
4
5
use Maestriam\Samurai\Entities\Theme;
6
use Maestriam\Samurai\Entities\Vendor;
7
use Maestriam\Samurai\Tests\TestCase;
8
9
/**
10
 * Testes de funcionalidades de definir/receber informações do vendor do tema
11
 */
12
class ThemeVendorTest extends TestCase
13
{
14
    /**
15
     * Verifica se consegue definir o vendor do tema
16
     *
17
     * @return void
18
     */
19
    public function testSetVendor()
20
    {
21
        $theme = new Theme('bands/warrant');
22
        
23
        $this->assertInstanceOf(Vendor::class, $theme->vendor());
24
    }  
25
    
26
    /**
27
     * Verifica se consegue recuperar o vendor do tema
28
     *
29
     * @return void
30
     */
31
    public function testGetVendorPackage()
32
    {
33
        $package = 'bands/warrant';
34
        
35
        $theme = new Theme($package);        
36
37
        $this->assertThemeVendor($theme->vendor(), $package);        
38
    }
39
40
    /**
41
     * Verifica se as informações do vendor, definidas no tema,
42
     * foram criadas com sucesso
43
     *
44
     * @param mixed $vendor
45
     * @param mixed $package
46
     * @return void
47
     */
48
    private function assertThemeVendor($vendor, $package)
49
    {
50
        $this->assertInstanceOf(Vendor::class, $vendor);
51
        $this->assertEquals($vendor->package(), $package);
52
    }
53
}