21 $tpl = $this->getMockBuilder(\ilTemplate::class)->disableOriginalConstructor()->getMock();
22 $lng = $this->getMockBuilder(\ilLanguage::class)->disableOriginalConstructor()->getMock();
23 $user = $this->getMockBuilder(\ilObjUser::class)->disableOriginalConstructor()->getMock();
24 $mail = $this->getMockBuilder(\ilFormatMail::class)->disableOriginalConstructor()->getMock();
25 $mailBox = $this->getMockBuilder(\ilMailbox::class)->disableOriginalConstructor()->getMock();
27 return new \ilMailOptionsGUI(
44 $request = $this->getMockBuilder(\
Psr\Http\Message\ServerRequestInterface::class)->disableOriginalConstructor()->getMock();
45 $ctrl = $this->getMockBuilder(\ilCtrl::class)->disableOriginalConstructor()->getMock();
46 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->getMock();
47 $form = $this->getMockBuilder(\ilMailOptionsFormGUI::class)->disableOriginalConstructor()->getMock();
49 $settings->expects($this->any())->method(
'get')->with(
'show_mail_settings')->willReturn(
'1');
50 $ctrl->expects($this->any())->method(
'getCmd')->willReturn(
'showOptions');
51 $request->expects($this->any())->method(
'getQueryParams')->willReturn([]);
55 $gui->executeCommand();
60 $request = $this->getMockBuilder(\
Psr\Http\Message\ServerRequestInterface::class)->disableOriginalConstructor()->getMock();
61 $ctrl = $this->getMockBuilder(\ilCtrl::class)->disableOriginalConstructor()->getMock();
62 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->getMock();
63 $form = $this->getMockBuilder(\ilMailOptionsFormGUI::class)->disableOriginalConstructor()->getMock();
65 $settings->expects($this->any())->method(
'get')->with(
'show_mail_settings')->willReturn(
'0');
66 $ctrl->expects($this->any())->method(
'getCmd')->willReturn(
'showOptions');
67 $request->expects($this->any())->method(
'getQueryParams')->willReturn([]);
69 $ctrl->expects($this->
once())->method(
'redirectByClass')->with(
'ilMailGUI');
73 $gui->executeCommand();
78 $request = $this->getMockBuilder(\
Psr\Http\Message\ServerRequestInterface::class)->disableOriginalConstructor()->getMock();
79 $ctrl = $this->getMockBuilder(\ilCtrl::class)->disableOriginalConstructor()->getMock();
80 $settings = $this->getMockBuilder(\ilSetting::class)->disableOriginalConstructor()->getMock();
81 $form = $this->getMockBuilder(\ilMailOptionsFormGUI::class)->disableOriginalConstructor()->getMock();
83 $settings->expects($this->any())->method(
'get')->with(
'show_mail_settings')->willReturn(
'0');
84 $ctrl->expects($this->any())->method(
'getCmd')->willReturn(
'showOptions');
86 $ctrl->expects($this->
once())->method(
'redirectByClass')->with(
'ilPersonalSettingsGUI');
87 $request->expects($this->any())->method(
'getQueryParams')->willReturn([
88 'referrer' =>
'ilPersonalSettingsGUI' 93 $gui->executeCommand();
This class provides processing control methods.
testMailOptionsAreNotAccessibleIfGlobalAccessIsDeniedAndUserWillBeRedirectedToPersonalSettings()
foreach($paths as $path) $request
Class ilMailOptionsGUITest.
if(isset($_POST['submit'])) $form
getMailOptionsGUI(\Psr\Http\Message\ServerRequestInterface $request, \ilCtrl $ctrl, \ilSetting $settings)
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
testMailOptionsAreAccessibleIfGlobalAccessIsNotDenied()
testMailOptionsAreNotAccessibleIfGlobalAccessIsDeniedAndUserWillBeRedirectedToMailSystem()