PathHelperTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getKernelClass() 0 6 1
A testGenerateRoutes() 0 14 1
1
<?php
2
3
namespace Liip\MonitorBundle\Tests\Helper;
4
5
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
6
use Symfony\Component\HttpKernel\Kernel;
7
8
class PathHelperTest extends WebTestCase
9
{
10
    public static function getKernelClass()
11
    {
12
        require_once __DIR__.'/../app/AppKernel.php';
13
14
        return 'AppKernel';
15
    }
16
17
    public function testGenerateRoutes()
18
    {
19
        $environment = 'symfony'.Kernel::MAJOR_VERSION;
20
        $client = static::createClient(['environment' => $environment]);
21
22
        $container = $client->getKernel()->getContainer();
23
24
        $pathHelper = $container->get('liip_monitor.helper');
25
26
        // test route is defined in Tests/app/routing.yml
27
        $routes = $pathHelper->generateRoutes(['test_route' => []]);
28
29
        $this->assertEquals(['api.test_route = "/monitor";'], $routes);
30
    }
31
}
32