Total Complexity | 2 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | class RebuildServiceTest extends TestCase |
||
17 | { |
||
18 | public function test_execute_methods() |
||
19 | { |
||
20 | $this->runExecuteTest('_posts'); |
||
21 | $this->runExecuteTest('_pages'); |
||
22 | $this->runExecuteTest('_docs'); |
||
23 | $this->runExecuteTest('_pages', '.blade.php'); |
||
24 | |||
25 | unlink(Hyde::path('_site/foo.html')); |
||
26 | unlink(Hyde::path('_site/docs/foo.html')); |
||
27 | unlink(Hyde::path('_site/posts/foo.html')); |
||
28 | } |
||
29 | |||
30 | protected function runExecuteTest(string $prefix, string $suffix = '.md') |
||
31 | { |
||
32 | $path = $prefix.'/foo'.$suffix; |
||
33 | Hyde::touch(($path)); |
||
34 | $service = new RebuildService($path); |
||
35 | $result = $service->execute(); |
||
36 | $this->assertInstanceOf(StaticPageBuilder::class, $result); |
||
37 | unlink(Hyde::path($path)); |
||
38 | } |
||
40 |