Passed
Branch master (1e39e8)
by Caen
03:01
created

ValidatesExistenceTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1
1
<?php
2
3
namespace Hyde\Framework\Testing\Unit;
4
5
use Hyde\Framework\Concerns\ValidatesExistence;
6
use Hyde\Framework\Exceptions\FileNotFoundException;
7
use Hyde\Framework\Models\Pages\BladePage;
8
use Hyde\Testing\TestCase;
9
10
/**
11
 * @covers \Hyde\Framework\Concerns\ValidatesExistence
12
 */
13
class ValidatesExistenceTest extends TestCase
14
{
15
    public function test_validate_existence_does_nothing_if_file_exists()
16
    {
17
        $class = new class
18
        {
19
            use ValidatesExistence;
20
        };
21
22
        $class->validateExistence(BladePage::class, 'index');
23
24
        $this->assertTrue(true);
25
    }
26
27
    public function test_validate_existence_throws_file_not_found_exception_if_file_does_not_exist()
28
    {
29
        $this->expectException(FileNotFoundException::class);
30
31
        $class = new class
32
        {
33
            use ValidatesExistence;
34
        };
35
36
        $class->validateExistence(BladePage::class, 'not-found');
37
    }
38
}
39