maestriam /
samurai
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Maestriam\Samurai\Tests\Feature\Console; |
||||
| 4 | |||||
| 5 | use Maestriam\Samurai\Exceptions\InvalidThemeNameException; |
||||
| 6 | use Maestriam\Samurai\Exceptions\ThemeExistsException; |
||||
| 7 | use Maestriam\Samurai\Tests\TestCase; |
||||
| 8 | |||||
| 9 | class MakeThemeCommandTest extends TestCase |
||||
| 10 | { |
||||
| 11 | public function testMakeValidTheme() |
||||
| 12 | { |
||||
| 13 | $theme = 'bands/helloween'; |
||||
| 14 | |||||
| 15 | $cmd = sprintf("samurai:make-theme %s", $theme); |
||||
| 16 | |||||
| 17 | $this->artisan($cmd)->assertExitCode(0); |
||||
| 18 | } |
||||
| 19 | |||||
| 20 | public function testInvalidTheme() |
||||
| 21 | { |
||||
| 22 | $theme = 'boy-bands'; |
||||
| 23 | |||||
| 24 | $cmd = sprintf("samurai:make-theme %s", $theme); |
||||
| 25 | |||||
| 26 | $this->artisan($cmd)->assertExitCode(InvalidThemeNameException::CODE); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 27 | } |
||||
| 28 | |||||
| 29 | public function testeCreatingExistingTheme() |
||||
| 30 | { |
||||
| 31 | $name = 'bands/helloween'; |
||||
| 32 | |||||
| 33 | $err = 'Error to create theme: The theme [%s] already exists in project.'; |
||||
| 34 | $cmd = sprintf('samurai:make-theme %s', $name); |
||||
| 35 | $out = sprintf($err, $name); |
||||
| 36 | |||||
| 37 | $this->artisan($cmd)->assertExitCode(0); |
||||
| 38 | |||||
| 39 | $this->artisan($cmd) |
||||
| 40 | ->expectsOutput($out) |
||||
| 41 | ->assertExitCode(ThemeExistsException::CODE); |
||||
|
0 ignored issues
–
show
Maestriam\Samurai\Except...meExistsException::CODE of type string is incompatible with the type integer expected by parameter $exitCode of Illuminate\Testing\Pendi...mmand::assertExitCode().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 42 | } |
||||
| 43 | } |