19 declare(strict_types=1);
40 $tpl = $this->getMockBuilder(ilGlobalTemplateInterface::class)->disableOriginalConstructor()->getMock();
41 $lng = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock();
42 $user = $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock();
61 $ctrl = $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->getMock();
62 $form = $this->getMockBuilder(ilMailOptionsFormGUI::class)->disableOriginalConstructor()->getMock();
64 $ctrl->method(
'getCmd')->willReturn(
'showOptions');
66 $request = $this->getMockBuilder(ServerRequestInterface::class)->disableOriginalConstructor()->getMock();
67 $request->method(
'getQueryParams')->willReturn([]);
70 $http = $this->getMockBuilder(GlobalHttpState::class)->getMock();
71 $http->method(
'wrapper')->willReturn($wrapper);
73 $settings = $this->getMockBuilder(ilSetting::class)->disableOriginalConstructor()->onlyMethods([
'get'])->getMock();
74 $settings->method(
'get')->willReturnCallback(
static function (
string $key, ?
string $default = null) {
75 if ($key ===
'show_mail_settings') {
86 $this->createMock(ilDBInterface::class)
91 $gui->executeCommand();
99 $ctrl = $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->getMock();
100 $form = $this->getMockBuilder(ilMailOptionsFormGUI::class)->disableOriginalConstructor()->getMock();
102 $ctrl->method(
'getCmd')->willReturn(
'showOptions');
104 $request = $this->getMockBuilder(ServerRequestInterface::class)->disableOriginalConstructor()->getMock();
105 $request->method(
'getQueryParams')->willReturn([]);
108 $http = $this->getMockBuilder(GlobalHttpState::class)->getMock();
109 $http->method(
'wrapper')->willReturn($wrapper);
111 $ctrl->expects($this->once())->method(
'redirectByClass')->with(ilMailGUI::class);
113 $settings = $this->getMockBuilder(ilSetting::class)->disableOriginalConstructor()->onlyMethods([
'get'])->getMock();
114 $settings->method(
'get')->willReturnCallback(
static function (
string $key, ?
string $default = null) {
115 if ($key ===
'show_mail_settings') {
126 $this->createMock(ilDBInterface::class)
130 $gui->setForm($form);
131 $gui->executeCommand();
139 $this->expectException(ilCtrlException::class);
141 $request = $this->getMockBuilder(ServerRequestInterface::class)->disableOriginalConstructor()->getMock();
142 $ctrl = $this->createMock(ilCtrlInterface::class);
143 $form = $this->getMockBuilder(ilMailOptionsFormGUI::class)->disableOriginalConstructor()->getMock();
145 $ctrl->method(
'getCmd')->willReturn(
'showOptions');
147 $ctrl->expects($this->once())->method(
'redirectByClass')->with(ilPersonalSettingsGUI::class)->willThrowException(
151 $settings = $this->getMockBuilder(ilSetting::class)->disableOriginalConstructor()->onlyMethods([
'get'])->getMock();
152 $settings->method(
'get')->willReturnCallback(
static function (
string $key, ?
string $default = null) {
153 if ($key ===
'show_mail_settings') {
160 $request = $this->getMockBuilder(ServerRequestInterface::class)->disableOriginalConstructor()->getMock();
161 $request->method(
'getQueryParams')->willReturn([
162 'referrer' => ilPersonalSettingsGUI::class,
166 $http = $this->getMockBuilder(GlobalHttpState::class)->getMock();
167 $http->method(
'wrapper')->willReturn($wrapper);
173 $this->createMock(ilDBInterface::class)
177 $gui->setForm($form);
178 $gui->executeCommand();
Interface GlobalHttpState.
Class ilMailOptions this class handles user mails.
testMailOptionsAreNotAccessibleIfGlobalAccessIsDeniedAndUserWillBeRedirectedToPersonalSettings()
Class ChatMainBarProvider .
Class ilMailOptionsGUITest.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMailOptionsGUI(GlobalHttpState $httpState, ilCtrlInterface $ctrl, ilMailOptions $mail_options)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
testMailOptionsAreAccessibleIfGlobalAccessIsNotDenied()
testMailOptionsAreNotAccessibleIfGlobalAccessIsDeniedAndUserWillBeRedirectedToMailSystem()