ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMailOptionsTest.php
Go to the documentation of this file.
1 <?php
2 
3 require_once 'Services/Mail/test/ilMailBaseTest.php';
4 
6 {
7  public function testConstructor()
8  {
9  $userId = 1;
10 
11  $database = $this->getMockBuilder('ilDBInterface')
12  ->disableOriginalConstructor()
13  ->getMock();
14  $queryMock = $this->getMockBuilder('ilPDOStatement')
15  ->disableOriginalConstructor()
16  ->setMethods(array('fetchRow'))
17  ->getMock();
18 
19  $object = $this->getMockBuilder(stdClass::class)->getMock();
20  $object->cronjob_notification = false;
21  $object->signature = 'smth';
22  $object->linebreak = false;
23  $object->incoming_type = 'MY';
24  $object->mail_address_option = 0;
25  $object->email = 'test@test.com';
26  $object->second_email = 'ilias@ilias.com';
27 
28 
29  $queryMock->method('fetchRow')->willReturn($object);
30  $database->expects($this->atLeastOnce())->method('queryF')->willReturn($queryMock);
31  $database->method('replace')->willReturn(0);
32 
33  $this->setGlobalVariable('ilDB', $database);
34 
35  $settings = $this->getMockBuilder('\ilSetting')->disableOriginalConstructor()->setMethods(array('set', 'get'))->getMock();
36  $this->setGlobalVariable('ilSetting', $settings);
37 
38  $mailOptions = new ilMailOptions($userId);
39  }
40 }
Class ilMailOptions this class handles user mails.
Create styles array
The data for the language used.
setGlobalVariable($name, $value)