"@include('some.path.here", ...) We will use Laravel's view path finder in order to transform the 'some.path.here' into a real file that we can open and inspect the html and thus fetch all devise tags from it.
Beispiel #1
0
 public function test_it_finds_all_included_views()
 {
     $finder = m::mock('Illuminate\\View\\FileViewFinder');
     $finder->shouldReceive('find')->times(4)->andReturn(__DIR__ . '/../../../fixtures/devise-views/view7.blade.php', __DIR__ . '/../../../fixtures/devise-views/view8.blade.php', __DIR__ . '/../../../fixtures/devise-views/view9.blade.php', __DIR__ . '/../../../fixtures/devise-views/view9.blade.php');
     $obj = new ViewOpener($finder);
     $views = $obj->findAllIncludedViews('view7');
     assertEquals(["devise::admin.pages.page-versions._cards", "devise::view10", "view9", "view7"], $views);
 }