◆ errorCollectionProvider()
| ilMailErrorFormatterTest::errorCollectionProvider |
( |
| ) |
|
Definition at line 49 of file ilMailErrorFormatterTest.php.
49 : array
50 {
51 return [
52 'Zero errors' => [
53 [],
54 ''
55 ],
56 'Exactly one error' => [
58 'error1'
59 ],
60 'Two errors' => [
62 'error1<ul><li>error2</li></ul>'
63 ],
64 'More than two errors with placeholders' => [
66 'error1<ul><li>error2</li><li>error3 (1. a/2. b/3. c)</li></ul>'
67 ],
68 ];
69 }
◆ setUp()
| ilMailErrorFormatterTest::setUp |
( |
| ) |
|
|
protected |
Reimplemented from ilMailBaseTest.
Definition at line 25 of file ilMailErrorFormatterTest.php.
25 : void
26 {
27 parent::setUp();
28
29 $componentFactory = $this->getMockBuilder(ilComponentFactory::class)->getMock();
30
32
33 $languageMock = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock();
34 $languageMock->method(
'txt')->willReturnCallback(
static function (
string $key):
string {
35 if (
'error1' ===
$key) {
36 return '-' .
$key .
'-';
37 }
38
39 if (
'error3' ===
$key) {
40 return $key .
' (1. %s/2. %s/3. %s)';
41 }
42
44 });
45
47 }
setGlobalVariable(string $name, $value)
References ILIAS\LTI\ToolProvider\$key, and ilMailBaseTest\setGlobalVariable().
◆ testErrorFormatter()
| ilMailErrorFormatterTest::testErrorFormatter |
( |
array |
$errors, |
|
|
string |
$expectedHtml |
|
) |
| |
◆ $errorFormatter
The documentation for this class was generated from the following file: