CreateIncluderTest::testMakeInclude()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 9
rs 10
1
<?php
2
3
namespace Maestriam\Samurai\Tests\Unit\Entities\Includer;
4
5
use Maestriam\Samurai\Entities\Includer;
6
use Maestriam\Samurai\Exceptions\DirectiveExistsException;
7
8
class CreateIncluderTest extends IncluderTestCase
9
{
10
    public function testMakeInclude()
11
    {
12
        $theme = $this->theme('bands/van-hallen');
13
14
        $include = new Includer($theme, 'tables/table');
15
16
        $file = $include->create();
17
18
        $this->assertFileExists($file->path());
19
    }
20
21
    public function testExistingIncluder()
22
    {
23
        $theme = $this->theme('bands/van-hallen');
24
25
        $include1 = new Includer($theme, 'tables/table');
26
        $include2 = new Includer($theme, 'tables/table');
27
28
        $this->expectException(DirectiveExistsException::class);
29
30
        $include1->create();
31
        $include2->create();
32
    }
33
}