ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMailBaseTestCase Class Reference
+ Inheritance diagram for ilMailBaseTestCase:
+ Collaboration diagram for ilMailBaseTestCase:

Protected Member Functions

 brutallyTrimHTML (string $html)
 
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 

Private Attributes

Container $dic = null
 

Detailed Description

Definition at line 25 of file ilMailBaseTestCase.php.

Member Function Documentation

◆ brutallyTrimHTML()

ilMailBaseTestCase::brutallyTrimHTML ( string  $html)
protected

Definition at line 29 of file ilMailBaseTestCase.php.

29 : string
30 {
31 $html = str_replace(["\n", "\r", "\t"], '', $html);
32 $html = preg_replace('# {2,}#', ' ', $html);
33 $html = preg_replace('/<!--(.|\s)*?-->/', '', $html);
34 $html = preg_replace("/>(\s+)</", '><', $html);
35 $html = str_replace([' >', ' <'], ['>', '<'], $html);
36
37 return trim($html);
38 }

Referenced by ilMailErrorFormatterTest\testErrorFormatter().

+ Here is the caller graph for this function:

◆ setGlobalVariable()

◆ setUp()

ilMailBaseTestCase::setUp ( )
protected

Reimplemented in ilMailAddressTypesTest, ilMailErrorFormatterTest, ilMailMimeTest, ilMailOptionsTest, and ilMailTaskProcessorTest.

Definition at line 40 of file ilMailBaseTestCase.php.

40 : void
41 {
42 if (!defined('ANONYMOUS_USER_ID')) {
43 define('ANONYMOUS_USER_ID', 13);
44 }
45
46 global $DIC;
47
48 $this->dic = is_object($DIC) ? clone $DIC : $DIC;
49
50 $DIC = new Container();
51 $DIC['legalDocuments'] = fn() => $this->getMockBuilder(Conductor::class)->disableOriginalConstructor()->getMock();
52
53 parent::setUp();
54 }

References $DIC.

◆ tearDown()

ilMailBaseTestCase::tearDown ( )
protected

Definition at line 56 of file ilMailBaseTestCase.php.

56 : void
57 {
58 global $DIC;
59
61
62 parent::tearDown();
63 }

References $DIC, and $dic.

Field Documentation

◆ $dic

Container ilMailBaseTestCase::$dic = null
private

Definition at line 27 of file ilMailBaseTestCase.php.

Referenced by tearDown().


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