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
38
39 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->setMethods(array(
40 'set',
41 'get'
42 ))->getMock();
44
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.