Completed
Push — master ( b1ab96...b5f370 )
by Mike
04:56
created

CreatesApplication::loadRoutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace GeneaLabs\LaravelCaffeine\Tests;
2
3
use GeneaLabs\LaravelCaffeine\Providers\Service as LaravelCaffeineService;
4
use Illuminate\Contracts\Console\Kernel;
5
6
trait CreatesApplication
7
{
8
    public function createApplication()
9
    {
10
        $this->loadRoutes();
11
        $app = require __DIR__ . '/../vendor/laravel/laravel/bootstrap/app.php';
12
        $app->make(Kernel::class)->bootstrap();
13
        $app->register(LaravelCaffeineService::class);
14
15
        return $app;
16
    }
17
18
    protected function loadRoutes()
19
    {
20
        $routes = file_get_contents(__DIR__ . '/../routes/web.php');
21
        file_put_contents(__DIR__ . '/../vendor/laravel/laravel/routes/web.php', $routes);
22
    }
23
}
24