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

TestCase::setUp()   A

Complexity

Conditions 4
Paths 8

Size

Total Lines 19
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 19
ccs 0
cts 10
cp 0
rs 9.9666
c 0
b 0
f 0
cc 4
nc 8
nop 0
crap 20
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