ILIAS  release_8 Revision v8.24
ilMailBodyPurifierTest Class Reference
+ Inheritance diagram for ilMailBodyPurifierTest:
+ Collaboration diagram for ilMailBodyPurifierTest:

Public Member Functions

 bodyProvider ()
 
 testMailBodyPurifier (string $body, string $expectedBody)
 @dataProvider bodyProvider More...
 
 testCarriageReturnCharactersAreRemoved ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilMailBaseTest
 brutallyTrimHTML (string $html)
 
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 

Detailed Description

Definition at line 21 of file ilMailBodyPurifierTest.php.

Member Function Documentation

◆ bodyProvider()

ilMailBodyPurifierTest::bodyProvider ( )

Definition at line 23 of file ilMailBodyPurifierTest.php.

23 : 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 }

◆ testCarriageReturnCharactersAreRemoved()

ilMailBodyPurifierTest::testCarriageReturnCharactersAreRemoved ( )

Definition at line 47 of file ilMailBodyPurifierTest.php.

47 : void
48 {
49 $purifier = new ilMailBodyPurifier();
50
51 $this->assertStringNotContainsString(chr(13), $purifier->purify(chr(13)));
52 }

◆ testMailBodyPurifier()

ilMailBodyPurifierTest::testMailBodyPurifier ( string  $body,
string  $expectedBody 
)

@dataProvider bodyProvider

Definition at line 40 of file ilMailBodyPurifierTest.php.

40 : void
41 {
42 $purifier = new ilMailBodyPurifier();
43
44 $this->assertSame($expectedBody, $purifier->purify($body));
45 }

The documentation for this class was generated from the following file: