Failed Conditions
Branch feature/refactoring-samurai (8cc7c1)
by Giuliano
03:47
created

LoadComposerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testLoadComposer() 0 18 1
1
<?php
2
3
namespace Maestriam\Samurai\Tests\Unit\Entities\Composer;
4
5
use Maestriam\Samurai\Tests\TestCase;
6
use Maestriam\Samurai\Entities\Theme;
7
use Maestriam\Samurai\Entities\Composer;
8
use stdClass;
9
10
class LoadComposerTest extends ComposerTestCase
11
{
12
    public function testLoadComposer()
13
    {
14
        $theme = $this->theme('bands/rolling-stones');
15
16
        $theme->make();
17
18
        $file = $theme->paths()->root() . '/composer.json';
19
        
20
        $composer = new Composer($theme);
21
22
        $info = $composer->load()->info();
23
24
        $this->assertFileExists($file);
25
        $this->assertInstanceOf(stdClass::class, $info);
26
        $this->assertIsString($info->description);
27
        $this->assertIsArray($info->authors);
28
        $this->assertIsString($info->authors[0]->name);
29
        $this->assertIsString($info->authors[0]->email);
30
    }   
31
}