]> BookStack Code Mirror - bookstack/blob - tests/Entity/PageContentTest.php
Updated Dutch language files
[bookstack] / tests / Entity / PageContentTest.php
1 <?php namespace Tests;
2
3 class PageContentTest extends BrowserKitTest
4 {
5
6     public function test_page_includes()
7     {
8         $page = \BookStack\Page::first();
9         $secondPage = \BookStack\Page::all()->get(2);
10
11         $secondPage->html = "<p id='section1'>Hello, This is a test</p><p id='section2'>This is a second block of content</p>";
12         $secondPage->save();
13
14         $this->asAdmin()->visit($page->getUrl())
15             ->dontSee('Hello, This is a test');
16
17         $originalHtml = $page->html;
18         $page->html .= "{{@{$secondPage->id}}}";
19         $page->save();
20
21         $this->asAdmin()->visit($page->getUrl())
22             ->see('Hello, This is a test')
23             ->see('This is a second block of content');
24
25         $page->html = $originalHtml . " Well {{@{$secondPage->id}#section2}}";
26         $page->save();
27
28         $this->asAdmin()->visit($page->getUrl())
29             ->dontSee('Hello, This is a test')
30             ->see('Well This is a second block of content');
31     }
32
33 }