mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-25 08:53:55 +08:00
Testing: Added entity decode flag and phpunit env option
- Passed decode flags to provide consistent behaviour across PHP versions during testing. - Added env option to prevent local option taking action in PHPunit tests.
This commit is contained in:
parent
3847a76134
commit
a720b3725d
|
@ -21,6 +21,7 @@
|
||||||
<server name="APP_AUTO_LANG_PUBLIC" value="true"/>
|
<server name="APP_AUTO_LANG_PUBLIC" value="true"/>
|
||||||
<server name="APP_URL" value="http://bookstack.dev"/>
|
<server name="APP_URL" value="http://bookstack.dev"/>
|
||||||
<server name="ALLOWED_IFRAME_HOSTS" value=""/>
|
<server name="ALLOWED_IFRAME_HOSTS" value=""/>
|
||||||
|
<server name="ALLOWED_SSR_HOSTS" value="*"/>
|
||||||
<server name="CACHE_DRIVER" value="array"/>
|
<server name="CACHE_DRIVER" value="array"/>
|
||||||
<server name="SESSION_DRIVER" value="array"/>
|
<server name="SESSION_DRIVER" value="array"/>
|
||||||
<server name="QUEUE_CONNECTION" value="sync"/>
|
<server name="QUEUE_CONNECTION" value="sync"/>
|
||||||
|
|
|
@ -257,7 +257,7 @@ class WatchTest extends TestCase
|
||||||
|
|
||||||
$notifications->assertSentTo($editor, function (CommentCreationNotification $notification) use ($editor, $admin, $entities) {
|
$notifications->assertSentTo($editor, function (CommentCreationNotification $notification) use ($editor, $admin, $entities) {
|
||||||
$mail = $notification->toMail($editor);
|
$mail = $notification->toMail($editor);
|
||||||
$mailContent = html_entity_decode(strip_tags($mail->render()));
|
$mailContent = html_entity_decode(strip_tags($mail->render()), ENT_QUOTES);
|
||||||
return $mail->subject === 'New comment on page: ' . $entities['page']->getShortName()
|
return $mail->subject === 'New comment on page: ' . $entities['page']->getShortName()
|
||||||
&& str_contains($mailContent, 'View Comment')
|
&& str_contains($mailContent, 'View Comment')
|
||||||
&& str_contains($mailContent, 'Page Name: ' . $entities['page']->name)
|
&& str_contains($mailContent, 'Page Name: ' . $entities['page']->name)
|
||||||
|
@ -280,7 +280,7 @@ class WatchTest extends TestCase
|
||||||
|
|
||||||
$notifications->assertSentTo($editor, function (PageUpdateNotification $notification) use ($editor, $admin) {
|
$notifications->assertSentTo($editor, function (PageUpdateNotification $notification) use ($editor, $admin) {
|
||||||
$mail = $notification->toMail($editor);
|
$mail = $notification->toMail($editor);
|
||||||
$mailContent = html_entity_decode(strip_tags($mail->render()));
|
$mailContent = html_entity_decode(strip_tags($mail->render()), ENT_QUOTES);
|
||||||
return $mail->subject === 'Updated page: Updated page'
|
return $mail->subject === 'Updated page: Updated page'
|
||||||
&& str_contains($mailContent, 'View Page')
|
&& str_contains($mailContent, 'View Page')
|
||||||
&& str_contains($mailContent, 'Page Name: Updated page')
|
&& str_contains($mailContent, 'Page Name: Updated page')
|
||||||
|
@ -309,7 +309,7 @@ class WatchTest extends TestCase
|
||||||
|
|
||||||
$notifications->assertSentTo($editor, function (PageCreationNotification $notification) use ($editor, $admin) {
|
$notifications->assertSentTo($editor, function (PageCreationNotification $notification) use ($editor, $admin) {
|
||||||
$mail = $notification->toMail($editor);
|
$mail = $notification->toMail($editor);
|
||||||
$mailContent = html_entity_decode(strip_tags($mail->render()));
|
$mailContent = html_entity_decode(strip_tags($mail->render()), ENT_QUOTES);
|
||||||
return $mail->subject === 'New page: My new page'
|
return $mail->subject === 'New page: My new page'
|
||||||
&& str_contains($mailContent, 'View Page')
|
&& str_contains($mailContent, 'View Page')
|
||||||
&& str_contains($mailContent, 'Page Name: My new page')
|
&& str_contains($mailContent, 'Page Name: My new page')
|
||||||
|
@ -347,7 +347,7 @@ class WatchTest extends TestCase
|
||||||
$notification = $notificationInfo[0]['notification'];
|
$notification = $notificationInfo[0]['notification'];
|
||||||
$this->assertInstanceOf(BaseActivityNotification::class, $notification);
|
$this->assertInstanceOf(BaseActivityNotification::class, $notification);
|
||||||
$mail = $notification->toMail($editor);
|
$mail = $notification->toMail($editor);
|
||||||
$mailContent = html_entity_decode(strip_tags($mail->render()));
|
$mailContent = html_entity_decode(strip_tags($mail->render()), ENT_QUOTES);
|
||||||
$this->assertStringContainsString('Name der Seite:', $mailContent);
|
$this->assertStringContainsString('Name der Seite:', $mailContent);
|
||||||
$this->assertStringContainsString('Diese Benachrichtigung wurde', $mailContent);
|
$this->assertStringContainsString('Diese Benachrichtigung wurde', $mailContent);
|
||||||
$this->assertStringContainsString('Sollte es beim Anklicken der Schaltfläche', $mailContent);
|
$this->assertStringContainsString('Sollte es beim Anklicken der Schaltfläche', $mailContent);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user