Passed
Push — stable ( 7698e0...f9d7ca )
by Nuno
03:02
created

CommandMakerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

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
7
class CommandMakerTest extends TestCase
8
{
9
    public function tearDown()
10
    {
11
        File::delete(app_path('Commands' . DIRECTORY_SEPARATOR . 'FooCommand.php'));
12
    }
13
14
    /** @test */
15
    public function it_creates_commands(): void
16
    {
17
        $this->app->call('make:command', ['name' => 'FooCommand']);
18
19
        $file = app_path('Commands'.DIRECTORY_SEPARATOR.'FooCommand.php');
20
21
        $this->assertTrue(File::exists($file));
22
        $this->assertContains('class FooCommand extends Command', File::get($file));
23
    }
24
}
25