ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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 26 of file ilMailBaseTestCase.php.

Member Function Documentation

◆ brutallyTrimHTML()

ilMailBaseTestCase::brutallyTrimHTML ( string  $html)
protected

Definition at line 30 of file ilMailBaseTestCase.php.

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

Referenced by ilMailErrorFormatterTest\testErrorFormatter().

+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

Definition at line 68 of file ilMailBaseTestCase.php.

68 : void
69 {
70 global $DIC;
71
72 $GLOBALS[$name] = $value;
73
74
75 unset($DIC[$name]);
76 $DIC[$name] = static fn(Container $c) => $GLOBALS[$name];
77 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:38
global $DIC
Definition: shib_login.php:26
$GLOBALS["DIC"]
Definition: wac.php:66

References Vendor\Package\$c, $DIC, and $GLOBALS.

Referenced by ilMailTest\testGetIliasMailerName().

+ Here is the caller graph for this function:

◆ setUp()

ilMailBaseTestCase::setUp ( )
protected

Reimplemented in ilMailAddressTypesTest, ilMailMimeTest, ilMailTaskProcessorTest, ILIAS\Mail\Message\MailMessageHtmlRendererTest, and MigrateMailAttachmentsToIRSSUnitTest.

Definition at line 41 of file ilMailBaseTestCase.php.

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

References $DIC, init(), and setUp().

+ Here is the call graph for this function:

◆ tearDown()

ilMailBaseTestCase::tearDown ( )
protected

Reimplemented in ilMailTemplatePlaceholderToEmptyResolverTest, and MigrateMailAttachmentsToIRSSUnitTest.

Definition at line 59 of file ilMailBaseTestCase.php.

59 : void
60 {
61 global $DIC;
62
64
66 }

References $DIC, $dic, and tearDown().

+ Here is the call graph for this function:

Field Documentation

◆ $dic

Container ilMailBaseTestCase::$dic = null
private

Definition at line 28 of file ilMailBaseTestCase.php.

Referenced by tearDown().


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