Passed
Branch stable (06c279)
by Nuno
05:21 queued 02:48
created

RenamerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 6 1
A it_renames_the_binary() 0 7 1
1
<?php
2
3
namespace Tests;
4
5
use Illuminate\Support\Facades\File;
6
7
class RenamerTest extends TestCase
8
{
9
    public function tearDown()
10
    {
11
        File::copy(base_path('save-composer.json'), base_path('composer.json'));
12
        File::copy(base_path('save-application'), base_path('application'));
13
        File::delete(base_path('zonda'));
14
    }
15
16
    /** @test */
17
    public function it_renames_the_binary(): void
18
    {
19
        $this->app->call('app:rename', ['name' => "zonda"]);
20
21
        $this->assertTrue(File::exists(base_path('zonda')));
22
        $this->assertContains('"bin": ["zonda"]', File::get(base_path('composer.json')));
23
    }
24
}
25