ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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.

Referenced by ilMailErrorFormatterTest\testErrorFormatter().

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  }
+ Here is the caller graph for this function:

◆ setGlobalVariable()

ilMailBaseTestCase::setGlobalVariable ( string  $name,
  $value 
)
protected

◆ setUp()

ilMailBaseTestCase::setUp ( )
protected

Definition at line 40 of file ilMailBaseTestCase.php.

References $DIC.

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  }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
global $DIC
Definition: shib_login.php:26

◆ tearDown()

ilMailBaseTestCase::tearDown ( )
protected

Definition at line 56 of file ilMailBaseTestCase.php.

References $DIC, and $dic.

56  : void
57  {
58  global $DIC;
59 
60  $DIC = $this->dic;
61 
62  parent::tearDown();
63  }
global $DIC
Definition: shib_login.php:26

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: