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

LoadComposerTest::testLoadComposer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 18
rs 9.9
c 0
b 0
f 0
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
}