ILIAS  release_8 Revision v8.24
ilMailBodyPurifierTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 public function bodyProvider(): array
24 {
25 return [
26 'Reply indicators are kept' => [
27 '> This is the original message' . chr(10) . '> Stretching over multiple lines',
28 '> This is the original message' . chr(10) . '> Stretching over multiple lines',
29 ],
30 'Reply indicators are kept, even if body contains (supported and unsupported) HTML' => [
31 '> This is the original <b>message</b>' . chr(10) . '> <section>Stretching</section> over multiple lines',
32 '> This is the original < b>message< /b>' . chr(10) . '> < section>Stretching< /section> over multiple lines',
33 ]
34 ];
35 }
36
40 public function testMailBodyPurifier(string $body, string $expectedBody): void
41 {
42 $purifier = new ilMailBodyPurifier();
43
44 $this->assertSame($expectedBody, $purifier->purify($body));
45 }
46
48 {
49 $purifier = new ilMailBodyPurifier();
50
51 $this->assertStringNotContainsString(chr(13), $purifier->purify(chr(13)));
52 }
53}
Class ilMailBaseTest.
testMailBodyPurifier(string $body, string $expectedBody)
@dataProvider bodyProvider