Completed
Push — cordoval-symfony-40 ( 19c157...0f4ab6 )
by Lukas Kahwe
17:05
created

PathHelperTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 24
rs 10
c 1
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 Liip\MonitorBundle\Helper\PathHelper;
6
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
7
use Symfony\Component\HttpKernel\Kernel;
8
9
class PathHelperTest extends WebTestCase
10
{
11
    static public function getKernelClass()
12
    {
13
        require_once __DIR__.'/../app/AppKernel.php';
14
15
        return 'AppKernel';
16
    }
17
18
    public function testGenerateRoutes()
19
    {
20
        $environment = 'symfony' . Kernel::MAJOR_VERSION;
21
        $client = static::createClient(array('environment' => $environment));
22
23
        $container = $client->getKernel()->getContainer();
24
25
        $pathHelper = $container->get('path_helper');
26
27
        // test route is defined in Tests/app/routing.yml
28
        $routes = $pathHelper->generateRoutes(['test_route' => []]);
29
30
        $this->assertEquals(['api.test_route = "/monitor";'], $routes);
31
    }
32
}
33