Class ilMailMimeTest.
More...
◆ getUserById()
ilMailMimeTest::getUserById |
( |
|
$usrId | ) |
|
|
protected |
- Parameters
-
- Returns
Definition at line 195 of file ilMailMimeTest.php.
References $user.
Referenced by setUp().
197 $user = $this->getMockBuilder(\ilObjUser::class)->disableOriginalConstructor()->setMethods(
200 $user->expects($this->any())->method(
'getId')->will($this->returnValue($usrId));
◆ setUp()
ilMailMimeTest::setUp |
( |
| ) |
|
|
protected |
◆ testFactoryWillReturnSystemSenderForAnonymousUserId()
ilMailMimeTest::testFactoryWillReturnSystemSenderForAnonymousUserId |
( |
| ) |
|
Definition at line 166 of file ilMailMimeTest.php.
References $factory.
168 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->setMethods(array(
173 $factory = new \ilMailMimeSenderFactory($settings);
174 $this->assertInstanceOf(
'\ilMailMimeSenderSystem',
$factory->getSenderByUsrId(\ANONYMOUS_USER_ID));
◆ testFactoryWillReturnSystemSenderWhenExplicitlyRequested()
ilMailMimeTest::testFactoryWillReturnSystemSenderWhenExplicitlyRequested |
( |
| ) |
|
Definition at line 180 of file ilMailMimeTest.php.
References $factory.
182 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->setMethods(array(
187 $factory = new \ilMailMimeSenderFactory($settings);
188 $this->assertInstanceOf(
'\ilMailMimeSenderSystem',
$factory->system());
◆ testFactoryWillReturnUserSenderForExistingUserId()
ilMailMimeTest::testFactoryWillReturnUserSenderForExistingUserId |
( |
| ) |
|
Definition at line 208 of file ilMailMimeTest.php.
References $factory.
210 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->setMethods(array(
215 $factory = new \ilMailMimeSenderFactory($settings);
216 $this->assertInstanceOf(
'\ilMailMimeSenderUser',
$factory->getSenderByUsrId(self::USER_ID));
◆ testFactoryWillReturnUserSenderWhenExplicitlyRequested()
ilMailMimeTest::testFactoryWillReturnUserSenderWhenExplicitlyRequested |
( |
| ) |
|
Definition at line 222 of file ilMailMimeTest.php.
References $factory.
224 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->setMethods(array(
229 $factory = new \ilMailMimeSenderFactory($settings);
230 $this->assertInstanceOf(
'\ilMailMimeSenderUser',
$factory->user(self::USER_ID));
◆ testMimMailDelegatesEmailDeliveryToDefaultTransport()
ilMailMimeTest::testMimMailDelegatesEmailDeliveryToDefaultTransport |
( |
| ) |
|
Definition at line 55 of file ilMailMimeTest.php.
References Sabre\Event\once(), and ilMailBaseTest\setGlobalVariable().
57 $defaultTransport = $this->getMockBuilder(\ilMailMimeTransport::class)->getMock();
58 $defaultTransport->expects($this->
once())->method(
'send');
60 $transportFactory = $this->getMockBuilder(\ilMailMimeTransportFactory::class)->disableOriginalConstructor()->getMock();
61 $transportFactory->expects($this->any())->method(
'getTransport')->will($this->returnValue($defaultTransport));
64 $settings = $this->getMockBuilder(
'\ilSetting')->disableOriginalConstructor()->setMethods(array(
70 $mail = new \ilMimeMail();
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
setGlobalVariable($name, $value)
◆ testMimMailDelegatesEmailDeliveryToThePassedTransporter()
ilMailMimeTest::testMimMailDelegatesEmailDeliveryToThePassedTransporter |
( |
| ) |
|
Definition at line 30 of file ilMailMimeTest.php.
References Sabre\Event\once(), and ilMailBaseTest\setGlobalVariable().
32 $defaultTransport = $this->getMockBuilder(\ilMailMimeTransport::class)->getMock();
33 $defaultTransport->expects($this->never())->method(
'send');
35 $transport = $this->getMockBuilder(\ilMailMimeTransport::class)->getMock();
36 $transport->expects($this->
once())->method(
'send');
38 $transportFactory = $this->getMockBuilder(\ilMailMimeTransportFactory::class)->disableOriginalConstructor()->getMock();
39 $transportFactory->expects($this->any())->method(
'getTransport')->will($this->returnValue($defaultTransport));
42 $settings = $this->getMockBuilder(
'\ilSetting')->disableOriginalConstructor()->setMethods(array(
48 $mail = new \ilMimeMail();
49 $mail->send($transport);
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
setGlobalVariable($name, $value)
◆ testTransportFactoryWillReturnNullTransportIfExternalEmailDeliveryIsDisabled()
ilMailMimeTest::testTransportFactoryWillReturnNullTransportIfExternalEmailDeliveryIsDisabled |
( |
| ) |
|
Definition at line 77 of file ilMailMimeTest.php.
References $factory, $key, and ilMailBaseTest\setGlobalVariable().
79 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->setMethods(array(
83 $settings->expects($this->any())->method(
'get')->will($this->returnCallback(
function (
$key) {
84 if (
'mail_allow_external' ==
$key) {
92 $eventHandler = $this->getMockBuilder(\ilAppEventHandler::class)->disableOriginalConstructor()->setMethods(array(
96 $factory = new \ilMailMimeTransportFactory($settings, $eventHandler);
97 $this->assertInstanceOf(
'\ilMailMimeTransportNull',
$factory->getTransport());
setGlobalVariable($name, $value)
◆ testTransportFactoryWillReturnSendmailTransportIfSmtpTransportIsDisabled()
ilMailMimeTest::testTransportFactoryWillReturnSendmailTransportIfSmtpTransportIsDisabled |
( |
| ) |
|
Definition at line 134 of file ilMailMimeTest.php.
References $factory, $key, and ilMailBaseTest\setGlobalVariable().
136 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->setMethods(array(
141 $settings->expects($this->any())->method(
'get')->will($this->returnCallback(
function (
$key) {
142 if (
'mail_allow_external' ==
$key) {
147 if (
'mail_smtp_status' ==
$key) {
155 $eventHandler = $this->getMockBuilder(\ilAppEventHandler::class)->disableOriginalConstructor()->setMethods(array(
159 $factory = new \ilMailMimeTransportFactory($settings, $eventHandler);
160 $this->assertInstanceOf(
'\ilMailMimeTransportSendMail',
$factory->getTransport());
setGlobalVariable($name, $value)
◆ testTransportFactoryWillReturnSmtpTransportIfEnabled()
ilMailMimeTest::testTransportFactoryWillReturnSmtpTransportIfEnabled |
( |
| ) |
|
Definition at line 103 of file ilMailMimeTest.php.
References $factory, $key, and ilMailBaseTest\setGlobalVariable().
105 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->setMethods(array(
109 $settings->expects($this->any())->method(
'get')->will($this->returnCallback(
function (
$key) {
110 if (
'mail_allow_external' ==
$key) {
115 if (
'mail_smtp_status' ==
$key) {
123 $eventHandler = $this->getMockBuilder(\ilAppEventHandler::class)->disableOriginalConstructor()->setMethods(array(
127 $factory = new \ilMailMimeTransportFactory($settings, $eventHandler);
128 $this->assertInstanceOf(
'\ilMailMimeTransportSmtp',
$factory->getTransport());
setGlobalVariable($name, $value)
◆ USER_ID
const ilMailMimeTest::USER_ID = 6 |
The documentation for this class was generated from the following file: