Completed
Push — stable ( 386c57...2cb6a4 )
by Nuno
02:05
created

CommandMakerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 4 1
A it_creates_commands() 0 9 1
1
<?php
2
3
namespace Tests;
4
5
use Illuminate\Support\Facades\File;
6
use Illuminate\Support\Facades\Artisan;
7
8
class CommandMakerTest extends TestCase
9
{
10
    public function tearDown()
11
    {
12
        File::delete(app_path('Commands'.DIRECTORY_SEPARATOR.'FooCommand.php'));
13
    }
14
15
    /** @test */
16
    public function it_creates_commands(): void
17
    {
18
        Artisan::call('make:command', ['name' => 'FooCommand']);
19
20
        $file = app_path('Commands'.DIRECTORY_SEPARATOR.'FooCommand.php');
21
22
        $this->assertTrue(File::exists($file));
23
        $this->assertContains('class FooCommand extends Command', File::get($file));
24
    }
25
}
26