GeneratedUrlAwareRouteContextTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGeneratedUrl() 0 6 1
A testReferenceType() 0 6 1
1
<?php
2
3
/*
4
 *
5
 * (c) Yaroslav Honcharuk <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Yarhon\RouteGuardBundle\Tests\Routing;
12
13
use PHPUnit\Framework\TestCase;
14
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
15
use Yarhon\RouteGuardBundle\Routing\GeneratedUrlAwareRouteContext;
16
17
/**
18
 * @author Yaroslav Honcharuk <[email protected]>
19
 */
20
class GeneratedUrlAwareRouteContextTest extends TestCase
21
{
22
    public function testReferenceType()
23
    {
24
        $context = new GeneratedUrlAwareRouteContext('route1');
25
        $context->setReferenceType(UrlGeneratorInterface::ABSOLUTE_PATH);
26
27
        $this->assertEquals(UrlGeneratorInterface::ABSOLUTE_PATH, $context->getReferenceType());
28
    }
29
30
    public function testGeneratedUrl()
31
    {
32
        $context = new GeneratedUrlAwareRouteContext('route1');
33
        $context->setGeneratedUrl('http://site.com/foo');
34
35
        $this->assertEquals('http://site.com/foo', $context->getGeneratedUrl());
36
    }
37
}
38