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

UseThemeCommandTest::getSuccessMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Maestriam\Samurai\Tests\Feature\Console;
4
5
use Maestriam\Samurai\Support\Samurai;
6
use Maestriam\Samurai\Tests\TestCase;
7
8
class UseThemeCommandTest extends TestCase
9
{    
10
    public function testMakeValidTheme()
11
    {
12
        $theme = $this->theme('bands/saxon')->findOrCreate();
13
        $cmd = sprintf("samurai:use %s", $theme->package());
14
        
15
        $message = $this->getSuccessMessage($theme->package());
16
17
        $this->artisan($cmd)
18
             ->assertExitCode(0)
19
             ->expectsOutput($message);
20
21
        $current = Samurai::base()->current();
0 ignored issues
show
Bug introduced by
The method base() does not exist on Maestriam\Samurai\Support\Samurai. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
        $current = Samurai::/** @scrutinizer ignore-call */ base()->current();
Loading history...
22
        
23
        $this->assertEquals($current->package(), $theme->package());
24
    }
25
26
    public function getSuccessMessage(string $name) : string
27
    {
28
        return sprintf('Theme [%s] is current and ready to use.', $name);
29
    }
30
31
}