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

PathHelperTest::getKernelClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
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