testReferenceType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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