MapTransformTest::testRun()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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