ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMailTransportSettingsTest Class Reference

Class ilMailTransportSettingsTest. More...

+ Inheritance diagram for ilMailTransportSettingsTest:
+ Collaboration diagram for ilMailTransportSettingsTest:

Public Member Functions

 testSystemAsIncomingTypeWontUpdate ()
 
 testOnlyFirstMailWillResultInUpdateProcess ()
 
 testOnlySecondMailWillResultInUpdateProcess ()
 
 testNoMailWillResultInUpdateProcess ()
 
 testNothingWillBeAdjusted ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilMailBaseTest
 setUp ()
 
 setGlobalVariable ($name, $value)
 
 assertException ($exception_class)
 

Detailed Description

Member Function Documentation

◆ testNoMailWillResultInUpdateProcess()

ilMailTransportSettingsTest::testNoMailWillResultInUpdateProcess ( )

Definition at line 76 of file ilMailTransportSettingsTest.php.

77 {
78 $mailOptions = $this->getMockBuilder(\ilMailOptions::class)
79 ->disableOriginalConstructor()
80 ->setMethods(array('updateOptions'))
81 ->getMock();
82
83 $mailOptions->expects($this->once())->method('updateOptions');
84 $mailOptions->setIncomingType(2);
85 $mailOptions->setMailAddressOption(3);
86
87 $setting = new ilMailTransportSettings($mailOptions);
88 $setting->adjust('', '');
89
90 $this->assertEquals(0, $mailOptions->getIncomingType());
91 }
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.

References Sabre\Event\once().

+ Here is the call graph for this function:

◆ testNothingWillBeAdjusted()

ilMailTransportSettingsTest::testNothingWillBeAdjusted ( )

Definition at line 96 of file ilMailTransportSettingsTest.php.

97 {
98 $mailOptions = $this->getMockBuilder(\ilMailOptions::class)
99 ->disableOriginalConstructor()
100 ->setMethods(array('updateOptions'))
101 ->getMock();
102
103 $mailOptions->expects($this->never())->method('updateOptions');
104 $mailOptions->setIncomingType(2);
105 $mailOptions->setMailAddressOption(5);
106
107 $setting = new ilMailTransportSettings($mailOptions);
108 $setting->adjust('test@ilias-test.de', 'someone@php-test.net');
109
110 $this->assertEquals(2, $mailOptions->getIncomingType());
111 $this->assertEquals(5, $mailOptions->getMailAddressOption());
112 }

◆ testOnlyFirstMailWillResultInUpdateProcess()

ilMailTransportSettingsTest::testOnlyFirstMailWillResultInUpdateProcess ( )

Definition at line 34 of file ilMailTransportSettingsTest.php.

35 {
36 $mailOptions = $this->getMockBuilder(\ilMailOptions::class)
37 ->disableOriginalConstructor()
38 ->setMethods(array('updateOptions'))
39 ->getMock();
40
41 $mailOptions->expects($this->once())->method('updateOptions');
42 $mailOptions->setIncomingType(2);
43 $mailOptions->setMailAddressOption(4);
44
45 $setting = new ilMailTransportSettings($mailOptions);
46 $setting->adjust('test@ilias-test.de', '');
47
48
49 $this->assertEquals(3, $mailOptions->getMailAddressOption());
50 }

References Sabre\Event\once().

+ Here is the call graph for this function:

◆ testOnlySecondMailWillResultInUpdateProcess()

ilMailTransportSettingsTest::testOnlySecondMailWillResultInUpdateProcess ( )

Definition at line 55 of file ilMailTransportSettingsTest.php.

56 {
57 $mailOptions = $this->getMockBuilder(\ilMailOptions::class)
58 ->disableOriginalConstructor()
59 ->setMethods(array('updateOptions'))
60 ->getMock();
61
62 $mailOptions->expects($this->once())->method('updateOptions');
63 $mailOptions->setIncomingType(2);
64 $mailOptions->setMailAddressOption(3);
65
66 $setting = new ilMailTransportSettings($mailOptions);
67 $setting->adjust('', 'test@ilias-test.de');
68
69
70 $this->assertEquals(4, $mailOptions->getMailAddressOption());
71 }

References Sabre\Event\once().

+ Here is the call graph for this function:

◆ testSystemAsIncomingTypeWontUpdate()

ilMailTransportSettingsTest::testSystemAsIncomingTypeWontUpdate ( )

Definition at line 13 of file ilMailTransportSettingsTest.php.

14 {
15 $mailOptions = $this->getMockBuilder(\ilMailOptions::class)
16 ->disableOriginalConstructor()
17 ->setMethods(array('updateOptions'))
18 ->getMock();
19
20 $mailOptions->setIncomingType(0);
21 $mailOptions->setMailAddressOption(3);
22
23 $setting = new ilMailTransportSettings($mailOptions);
24 $setting->adjust('test@ilias-test.de', 'someone@php-test.net');
25
26
27 $this->assertEquals(0, $mailOptions->getIncomingType());
28 $this->assertEquals(3, $mailOptions->getMailAddressOption());
29 }

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