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

Class ilMailOptionsTest. More...

+ Inheritance diagram for ilMailOptionsTest:
+ Collaboration diagram for ilMailOptionsTest:

Public Member Functions

 testConstructor ()
 

Additional Inherited Members

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

Detailed Description

Member Function Documentation

◆ testConstructor()

ilMailOptionsTest::testConstructor ( )
Exceptions
ReflectionException

Definition at line 14 of file ilMailOptionsTest.php.

15 {
16 $userId = 1;
17
18 $database = $this->getMockBuilder(ilDBInterface::class)
19 ->getMock();
20 $queryMock = $this->getMockBuilder(ilDBStatement::class)
21 ->getMock();
22
23 $object = $this->getMockBuilder(stdClass::class)->getMock();
24 $object->cronjob_notification = false;
25 $object->signature = 'smth';
26 $object->linebreak = false;
27 $object->incoming_type = 0;
28 $object->mail_address_option = 0;
29 $object->email = 'test@test.com';
30 $object->second_email = 'ilias@ilias.com';
31
32
33 $database->expects($this->once())->method('fetchObject')->willReturn($object);
34 $database->expects($this->once())->method('queryF')->willReturn($queryMock);
35 $database->method('replace')->willReturn(0);
36
37 $this->setGlobalVariable('ilDB', $database);
38
39 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->setMethods(array(
40 'set',
41 'get'
42 ))->getMock();
43 $this->setGlobalVariable('ilSetting', $settings);
44
45 $mailOptions = new ilMailOptions($userId);
46 $this->assertEquals($object->signature, $mailOptions->getSignature());
47 $this->assertEquals($object->incoming_type, $mailOptions->getIncomingType());
48 $this->assertEquals($object->linebreak, $mailOptions->getLinebreak());
49 $this->assertEquals($object->cronjob_notification, $mailOptions->getCronjobNotification());
50 }
setGlobalVariable($name, $value)
Class ilMailOptions this class handles user mails.
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.

References Sabre\Event\once(), and ilMailBaseTest\setGlobalVariable().

+ Here is the call graph for this function:

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