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

ViewPathDetectorTest::test_for_generateViewPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 8
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Nip\Controllers\Tests\View;
4
5
use Nip\Controllers\Tests\AbstractTest;
6
use Nip\Controllers\Tests\Fixtures\Controllers\Parent\ChildController;
7
use Nip\Controllers\Tests\Fixtures\Controllers\ViewController;
8
use Nip\Controllers\View\ViewPathDetector;
9
10
/**
11
 * Class ViewPathDetectorTest
12
 * @package Nip\Controllers\Tests\View
13
 */
14
class ViewPathDetectorTest extends AbstractTest
15
{
16
    public function test_for_autodetect()
17
    {
18
        $path = TEST_FIXTURE_PATH . DIRECTORY_SEPARATOR . 'views';
19
        self::assertSame( $path, ViewPathDetector::for(new ChildController()));
20
    }
21
22
    public function test_for_generateViewPath()
23
    {
24
        $path = TEST_FIXTURE_PATH . DIRECTORY_SEPARATOR . 'views';
25
26
        $controller = \Mockery::mock(ViewController::class)->makePartial()->shouldAllowMockingProtectedMethods();
27
        $controller->shouldReceive('generateViewPath')->once()->andReturn($path);
28
29
        self::assertSame( $path, ViewPathDetector::for($controller));
30
    }
31
}