RouteContextTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testConstructDefaultValues() 0 7 1
A testConstructAllValues() 0 7 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 Yarhon\RouteGuardBundle\Routing\RouteContext;
15
16
/**
17
 * @author Yaroslav Honcharuk <[email protected]>
18
 */
19
class RouteContextTest extends TestCase
20
{
21
    public function testConstructDefaultValues()
22
    {
23
        $context = new RouteContext('route1');
24
25
        $this->assertSame('route1', $context->getName());
26
        $this->assertSame([], $context->getParameters());
27
        $this->assertSame('GET', $context->getMethod());
28
    }
29
30
    public function testConstructAllValues()
31
    {
32
        $context = new RouteContext('route1', ['q' => 1], 'POST');
33
34
        $this->assertSame('route1', $context->getName());
35
        $this->assertSame(['q' => 1], $context->getParameters());
36
        $this->assertSame('POST', $context->getMethod());
37
    }
38
}
39