Passed
Push — master ( b6b0b7...148695 )
by Gabriel
03:18
created

PathTest::test_basePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Nip\Controllers\Tests\Utility;
4
5
use Nip\Controllers\Tests\AbstractTest;
6
use Nip\Controllers\Tests\Fixtures\Controllers\BaseController;
7
use Nip\Controllers\Tests\Fixtures\Controllers\Parent\ChildController;
8
use Nip\Controllers\Utility\Path;
9
10
/**
11
 * Class PathTest
12
 * @package Nip\Controllers\Tests\Utility
13
 */
14
class PathTest extends AbstractTest
15
{
16
    /**
17
     * @dataProvider data_basePath
18
     * @param $controller
19
     * @param $path
20
     */
21
    public function test_basePath($controller, $path)
22
    {
23
        self::assertSame($path, Path::basePath($controller));
24
    }
25
26
    /**
27
     * @return \string[][]
28
     */
29
    public function data_basePath()
30
    {
31
        $path = TEST_FIXTURE_PATH . DIRECTORY_SEPARATOR . 'Controllers';
32
        return [
33
            [BaseController::class, $path],
34
            [ChildController::class, $path],
35
            [new BaseController(), $path],
36
            [new ChildController(), $path],
37
        ];
38
    }
39
}
40