ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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 28 of file ilMailBaseTest.php.

Member Function Documentation

◆ brutallyTrimHTML()

ilMailBaseTest::brutallyTrimHTML ( string  $html)
protected

Definition at line 32 of file ilMailBaseTest.php.

Referenced by ilMailErrorFormatterTest\testErrorFormatter().

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

◆ setGlobalVariable()

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

Definition at line 67 of file ilMailBaseTest.php.

References $c, $DIC, $GLOBALS, and $name.

Referenced by ilMailErrorFormatterTest\setUp(), ilMailOptionsTest\setUp(), ilMailTest\testExternalMailDeliveryToLocalRecipientsWorksAsExpected(), ilMailTest\testGetIliasMailerName(), ilMailMimeTest\testMimMailDelegatesEmailDeliveryToDefaultTransport(), ilMailMimeTest\testMimMailDelegatesEmailDeliveryToThePassedTransporter(), ilMailMimeTest\testTransportFactoryWillReturnNullTransportIfExternalEmailDeliveryIsDisabled(), ilMailMimeTest\testTransportFactoryWillReturnSendmailTransportIfSmtpTransportIsDisabled(), and ilMailMimeTest\testTransportFactoryWillReturnSmtpTransportIfEnabled().

67  : void
68  {
69  global $DIC;
70 
71  $GLOBALS[$name] = $value;
72 
73 
74  unset($DIC[$name]);
75  $DIC[$name] = static function (Container $c) use ($name) {
76  return $GLOBALS[$name];
77  };
78  }
$c
Definition: cli.php:38
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the caller graph for this function:

◆ setUp()

ilMailBaseTest::setUp ( )
protected

Definition at line 43 of file ilMailBaseTest.php.

References $DIC.

43  : void
44  {
45  if (!defined('ANONYMOUS_USER_ID')) {
46  define('ANONYMOUS_USER_ID', 13);
47  }
48 
49  global $DIC;
50 
51  $this->dic = is_object($DIC) ? clone $DIC : $DIC;
52 
53  $DIC = new Container();
54 
55  parent::setUp();
56  }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
global $DIC
Definition: feed.php:28

◆ tearDown()

ilMailBaseTest::tearDown ( )
protected

Definition at line 58 of file ilMailBaseTest.php.

References $DIC, and $dic.

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

Field Documentation

◆ $dic

Container ilMailBaseTest::$dic = null
private

Definition at line 30 of file ilMailBaseTest.php.

Referenced by tearDown().


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