TestCase   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
eloc 9
c 2
b 0
f 1
dl 0
loc 20
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 3 1
A getEnvironmentSetUp() 0 4 1
A addApiRoutes() 0 7 1
1
<?php
2
3
namespace TobyMaxham\Helper\Tests;
4
5
use TobyMaxham\Helper\Http\Middleware\Cors;
6
use Orchestra\Testbench\TestCase as Orchestra;
7
8
class TestCase extends Orchestra
9
{
10
    protected function setUp()
11
    {
12
        parent::setUp();
13
    }
14
15
    protected function getEnvironmentSetUp($app)
16
    {
17
        $router = $app['router'];
18
        $this->addApiRoutes($router);
19
    }
20
21
    private function addApiRoutes($router)
22
    {
23
        $router->group(['middleware' => Cors::class], function () use ($router) {
24
            $router->get('api/ping', [
25
                'as'   => 'api.ping',
26
                'uses' => function () {
27
                    return 'pong';
28
                },
29
            ]);
30
        });
31
    }
32
}
33