ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMailBaseTestCase Class Reference

Class ilMailBaseTest. More...

+ 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

Class ilMailBaseTest.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de

Definition at line 29 of file ilMailBaseTestCase.php.

Member Function Documentation

◆ brutallyTrimHTML()

ilMailBaseTestCase::brutallyTrimHTML ( string  $html)
protected

Definition at line 33 of file ilMailBaseTestCase.php.

Referenced by ilMailErrorFormatterTest\testErrorFormatter().

33  : string
34  {
35  $html = str_replace(["\n", "\r", "\t"], "", $html);
36  $html = preg_replace('# {2,}#', " ", $html);
37  $html = preg_replace('/<!--(.|\s)*?-->/', '', $html);
38  $html = preg_replace("/>(\s+)</", "><", $html);
39  $html = str_replace([" >", " <"], [">", "<"], $html);
40 
41  return trim($html);
42  }
+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

◆ setUp()

ilMailBaseTestCase::setUp ( )
protected

Definition at line 44 of file ilMailBaseTestCase.php.

References $DIC.

44  : void
45  {
46  if (!defined('ANONYMOUS_USER_ID')) {
47  define('ANONYMOUS_USER_ID', 13);
48  }
49 
50  global $DIC;
51 
52  $this->dic = is_object($DIC) ? clone $DIC : $DIC;
53 
54  $DIC = new Container();
55  $DIC['legalDocuments'] = fn() => $this->getMockBuilder(Conductor::class)->disableOriginalConstructor()->getMock();
56 
57  parent::setUp();
58  }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
global $DIC
Definition: shib_login.php:22

◆ tearDown()

ilMailBaseTestCase::tearDown ( )
protected

Definition at line 60 of file ilMailBaseTestCase.php.

References $DIC, and $dic.

60  : void
61  {
62  global $DIC;
63 
64  $DIC = $this->dic;
65 
66  parent::tearDown();
67  }
global $DIC
Definition: shib_login.php:22

Field Documentation

◆ $dic

Container ilMailBaseTestCase::$dic = null
private

Definition at line 31 of file ilMailBaseTestCase.php.

Referenced by tearDown().


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