MapTransformTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 23
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A runData() 0 7 1
A testRun() 0 3 1
1
<?php
2
3
namespace Nip\Router\Tests\Utility;
4
5
use Nip\Router\Tests\AbstractTest;
6
use Nip\Router\Utility\MapTransform;
7
8
/**
9
 * Class MapTransformTest
10
 * @package Nip\Router\Tests\Utility
11
 */
12
class MapTransformTest extends AbstractTest
13
{
14
15
    /**
16
     * @param $map
17
     * @param $transform
18
     * @dataProvider runData()
19
     */
20
    public function testRun($map, $transform)
21
    {
22
        self::assertSame($transform, MapTransform::run($map));
23
    }
24
25
    /**
26
     * @return array
27
     */
28
    public function runData()
29
    {
30
        return [
31
            ['simple', 'simple'],
32
            ['/index/index', '/index/index'],
33
            ['/admin/:index', '/admin/{index}'],
34
            ['/admin/:controller/:action', '/admin/{controller}/{action?index}'],
35
        ];
36
    }
37
}
38