Test Failed
Push — stable ( 994ca0...7d5c83 )
by Nuno
04:30
created

TestCase   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
eloc 10
dl 0
loc 24
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 19 4
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of Laravel Zero.
7
 *
8
 * (c) Nuno Maduro <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace LaravelZero\Framework\Testing;
15
16
use Illuminate\Support\Facades\Facade;
17
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
18
19
abstract class TestCase extends BaseTestCase
20
{
21
    /**
22
     * Setup the test environment.
23
     */
24
    protected function setUp(): void
25
    {
26
        if (! $this->app) {
27
            $this->refreshApplication();
28
        }
29
30
        $this->setUpTraits();
31
32
        foreach ($this->afterApplicationCreatedCallbacks as $callback) {
33
            call_user_func($callback);
34
        }
35
36
        Facade::clearResolvedInstances();
37
38
        if (class_exists(\Illuminate\Database\Eloquent\Model::class)) {
39
            \Illuminate\Database\Eloquent\Model::setEventDispatcher($this->app['events']);
40
        }
41
42
        $this->setUpHasRun = true;
43
    }
44
}
45