Passed
Push — master ( e5b31a...cf340d )
by Arthur
04:48
created

RefreshDatabase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 16
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A runDatabaseMigrations() 0 10 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arthur
5
 * Date: 11.10.18
6
 * Time: 22:53.
7
 */
8
9
namespace Foundation\Traits;
10
11
use Illuminate\Foundation\Testing\DatabaseMigrations;
12
use Illuminate\Foundation\Testing\RefreshDatabaseState;
13
14
trait RefreshDatabase
15
{
16
    use DatabaseMigrations {
17
        DatabaseMigrations::runDatabaseMigrations as parentMethod;
18
    }
19
20 19
    public function runDatabaseMigrations()
21
    {
22 19
        $this->artisan('migrate:fresh');
0 ignored issues
show
Bug introduced by
It seems like artisan() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

22
        $this->/** @scrutinizer ignore-call */ 
23
               artisan('migrate:fresh');
Loading history...
23 19
        $this->artisan('cache:clear');
24 19
        $this->artisan('db:seed');
25
26
        $this->beforeApplicationDestroyed(function () {
0 ignored issues
show
Bug introduced by
It seems like beforeApplicationDestroyed() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

26
        $this->/** @scrutinizer ignore-call */ 
27
               beforeApplicationDestroyed(function () {
Loading history...
27 19
            $this->artisan('cache:clear');
28 19
            $this->artisan('migrate:rollback');
29 19
            RefreshDatabaseState::$migrated = false;
30 19
        });
31 19
    }
32
}
33