3 require_once
'Services/Mail/test/ilMailBaseTest.php';
4 require_once
'Services/Mail/classes/class.ilMailOptions.php';
10 $mailOptions = $this->getMockBuilder(
'ilMailOptions')
11 ->disableOriginalConstructor()
12 ->setMethods(
array(
'updateOptions'))
15 $mailOptions->setIncomingType(0);
16 $mailOptions->setMailAddressOption(3);
19 $setting->adjust(
'test@ilias-test.de',
'someone@php-test.net');
22 $this->assertEquals(0, $mailOptions->getIncomingType());
23 $this->assertEquals(3, $mailOptions->getMailAddressOption());
28 $mailOptions = $this->getMockBuilder(
'ilMailOptions')
29 ->disableOriginalConstructor()
30 ->setMethods(
array(
'updateOptions'))
33 $mailOptions->expects($this->once())->method(
'updateOptions');
34 $mailOptions->setIncomingType(2);
35 $mailOptions->setMailAddressOption(4);
38 $setting->adjust(
'test@ilias-test.de',
'');
41 $this->assertEquals(3, $mailOptions->getMailAddressOption());
46 $mailOptions = $this->getMockBuilder(
'ilMailOptions')
47 ->disableOriginalConstructor()
48 ->setMethods(
array(
'updateOptions'))
51 $mailOptions->expects($this->once())->method(
'updateOptions');
52 $mailOptions->setIncomingType(2);
53 $mailOptions->setMailAddressOption(3);
56 $setting->adjust(
'',
'test@ilias-test.de');
59 $this->assertEquals(4, $mailOptions->getMailAddressOption());
64 $mailOptions = $this->getMockBuilder(
'ilMailOptions')
65 ->disableOriginalConstructor()
66 ->setMethods(
array(
'updateOptions'))
69 $mailOptions->expects($this->once())->method(
'updateOptions');
70 $mailOptions->setIncomingType(2);
71 $mailOptions->setMailAddressOption(3);
74 $setting->adjust(
'',
'');
76 $this->assertEquals(0, $mailOptions->getIncomingType());
81 $mailOptions = $this->getMockBuilder(
'ilMailOptions')
82 ->disableOriginalConstructor()
83 ->setMethods(
array(
'updateOptions'))
86 $mailOptions->expects($this->never())->method(
'updateOptions');
87 $mailOptions->setIncomingType(2);
88 $mailOptions->setMailAddressOption(5);
91 $setting->adjust(
'test@ilias-test.de',
'someone@php-test.net');
93 $this->assertEquals(2, $mailOptions->getIncomingType());
94 $this->assertEquals(5, $mailOptions->getMailAddressOption());
testNoMailWillResultInUpdateProcess()
testSystemAsIncomingTypeWontUpdate()
testOnlySecondMailWillResultInUpdateProcess()
testNothingWillBeAdjusted()
testOnlyFirstMailWillResultInUpdateProcess()
Create styles array
The data for the language used.