PathHelperTest::testGenerateRoutes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 0
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