Completed
Push — master ( c1adf5...002a39 )
by Alex
02:26
created

LoaderExceptionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 18
rs 10
1
<?php
2
3
namespace Asmaster\EquipTwig\Tests\Exception;
4
5
use Asmaster\EquipTwig\Exception\ExceptionInterface;
6
use Asmaster\EquipTwig\Exception\LoaderException;
7
use PHPUnit_Framework_TestCase as TestCase;
8
use Twig_Error_Loader as TwigErrorLoader;
9
10
class LoaderExceptionTest extends TestCase
11
{
12
    public function testLoaderException()
13
    {
14
        $template = 'nowhere';
15
        $where = __DIR__;
16
17
        $exception = LoaderException::notFound($template, $where);
18
19
        $this->assertInstanceOf(LoaderException::class, $exception);
20
        $this->assertInstanceOf(TwigErrorLoader::class, $exception);
21
        $this->assertInstanceOf(ExceptionInterface::class, $exception);
22
        $this->assertSame(
23
            'Unable to find template `'. $template .'` (looked into: '. $where . ').',
24
            $exception->getMessage()
25
        );
26
    }
27
}
28