11 $user = $this->getMockBuilder(
'ilObjUser')
12 ->disableOriginalConstructor()
15 $ui = $this->getMockBuilder(
'\ILIAS\DI\UIServices')
16 ->disableOriginalConstructor()
17 ->setMethods(array(
'messageBox',
'factory',
'renderer'))
20 $factory = $this->getMockBuilder(
'\ILIAS\UI\Factory')
21 ->disableOriginalConstructor()
24 $button = $this->getMockBuilder(
'\ILIAS\UI\Component\Button')
25 ->disableOriginalConstructor()
26 ->setMethods(array(
'standard'))
29 $standard = $this->getMockBuilder(
'\ILIAS\UI\Component\Button\Standard')
30 ->disableOriginalConstructor()
33 $button->method(
'standard')
34 ->willReturn($standard);
37 ->willReturn($button);
39 $ui->method(
'factory')
42 $renderer = $this->getMockBuilder(
'\ILIAS\UI\Renderer')
43 ->disableOriginalConstructor()
46 $ui->method(
'renderer')
47 ->willReturn($renderer);
49 $messageBox = $this->getMockBuilder(
'\ILIAS\UI\Component\MessageBox\Factory')
50 ->disableOriginalConstructor()
53 $failure = $this->getMockBuilder(
'\ILIAS\UI\Component\MessageBox\MessageBox')
54 ->disableOriginalConstructor()
57 $withButton = $this->getMockBuilder(
'MessageBox')
58 ->disableOriginalConstructor()
62 ->willReturn($withButton);
64 $messageBox->method(
'failure')
68 ->willReturn($messageBox);
70 $language = $this->getMockBuilder(
'\ilLanguage')
71 ->disableOriginalConstructor()
74 $migrationUiElements = $this->getMockBuilder(
'\ilCertificateMigration')
75 ->disableOriginalConstructor()
78 $migrationUiElements->method(
'isTaskFailed')
81 $renderer->method(
'render')
83 ->willReturn(
'<alert></alert>');
92 $html = $migrationUiElements->getMigrationMessageBox(
'someLink');
94 $this->assertSame(
'<alert></alert>',
$html);
99 $user = $this->getMockBuilder(
'ilObjUser')
100 ->disableOriginalConstructor()
103 $ui = $this->getMockBuilder(
'\ILIAS\DI\UIServices')
104 ->disableOriginalConstructor()
105 ->setMethods(array(
'messageBox',
'factory',
'renderer'))
108 $factory = $this->getMockBuilder(
'\ILIAS\UI\Factory')
109 ->disableOriginalConstructor()
112 $button = $this->getMockBuilder(
'\ILIAS\UI\Component\Button')
113 ->disableOriginalConstructor()
114 ->setMethods(array(
'standard'))
117 $standard = $this->getMockBuilder(
'\ILIAS\UI\Component\Button\Standard')
118 ->disableOriginalConstructor()
121 $button->method(
'standard')
122 ->willReturn($standard);
125 ->willReturn($button);
127 $ui->method(
'factory')
130 $renderer = $this->getMockBuilder(
'\ILIAS\UI\Renderer')
131 ->disableOriginalConstructor()
134 $ui->method(
'renderer')
135 ->willReturn($renderer);
137 $messageBox = $this->getMockBuilder(
'\ILIAS\UI\Component\MessageBox\Factory')
138 ->disableOriginalConstructor()
141 $confirm = $this->getMockBuilder(
'\ILIAS\UI\Component\MessageBox\MessageBox')
142 ->disableOriginalConstructor()
145 $withButton = $this->getMockBuilder(
'MessageBox')
146 ->disableOriginalConstructor()
149 $confirm->method(
'withButtons')
150 ->willReturn($withButton);
152 $messageBox->method(
'confirmation')
153 ->willReturn($confirm);
156 ->willReturn($messageBox);
158 $language = $this->getMockBuilder(
'\ilLanguage')
159 ->disableOriginalConstructor()
162 $migrationUiElements = $this->getMockBuilder(
'\ilCertificateMigration')
163 ->disableOriginalConstructor()
166 $migrationUiElements->method(
'isTaskFailed')
169 $renderer->method(
'render')
171 ->willReturn(
'<confirm></confirm>');
180 $html = $migrationUiElements->getMigrationMessageBox(
'someLink');
182 $this->assertSame(
'<confirm></confirm>',
$html);
Class ilCertificateMigrationUIElements.
testTaskFailedWillDisplayedFailureMessageBox()
testTaskIsNotFailedWillDisplayConfirmMessageBox()