ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilMailBaseTest Class Reference

Class ilMailBaseTest. More...

+ Inheritance diagram for ilMailBaseTest:
+ Collaboration diagram for ilMailBaseTest:

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 ilMailBaseTest.php.

Member Function Documentation

◆ brutallyTrimHTML()

ilMailBaseTest::brutallyTrimHTML ( string  $html)
protected

Definition at line 33 of file ilMailBaseTest.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()

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

◆ setUp()

ilMailBaseTest::setUp ( )
protected

Definition at line 44 of file ilMailBaseTest.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: feed.php:28

◆ tearDown()

ilMailBaseTest::tearDown ( )
protected

Definition at line 60 of file ilMailBaseTest.php.

References $DIC, and $dic.

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

Field Documentation

◆ $dic

Container ilMailBaseTest::$dic = null
private

Definition at line 31 of file ilMailBaseTest.php.

Referenced by tearDown().


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