mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Refactored the code for ExportService to use DomDocument.
Fixes #883 Also handling more scenarios.
This commit is contained in:
@@ -157,4 +157,29 @@ class ExportTest extends TestCase
|
||||
|
||||
}
|
||||
|
||||
public function test_pdf_export_no_video_iframe() {
|
||||
$page = Page::first();
|
||||
$page->html = '<p id="bkmrk-%C2%A0-0"> </p>' .
|
||||
'<p id="bkmrk-%C2%A0-1"><iframe src="//www.youtube.com/embed/LkFt_fp7FmE" width="560" height="314" allowfullscreen="allowfullscreen"></iframe></p>' .
|
||||
'<p id="bkmrk-"><video src="//player.vimeo.com/video/276396369?title=0&amp;byline=0" width="425" height="350" allowfullscreen="allowfullscreen"></video></p>' .
|
||||
'<p id="bkmrk--0"><iframe style="border: 0;" src="//maps.google.com/embed?testquery=true" width="600" height="450" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>' .
|
||||
'<p id="bkmrk--1"><iframe src="//www.dailymotion.com/embed/video/x2rqgfm" width="480" height="432" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>' .
|
||||
'<p id="bkmrk-%C2%A0-2"> </p>';
|
||||
|
||||
$page->save();
|
||||
|
||||
$this->asEditor();
|
||||
$resp = $this->get($page->getUrl('/export/pdf?isTesting=true'));
|
||||
$resp->assertStatus(200);
|
||||
|
||||
$checks = [
|
||||
'</video>',
|
||||
'</iframe>'
|
||||
];
|
||||
|
||||
foreach ($checks as $check) {
|
||||
$resp->assertDontSee($check);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user