ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 (string $name, $value)
 

Detailed Description

Member Function Documentation

◆ testConstructor()

ilMailOptionsTest::testConstructor ( )
Exceptions
ReflectionException

Definition at line 15 of file ilMailOptionsTest.php.

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

References ilMailBaseTest\setGlobalVariable().

+ Here is the call graph for this function:

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