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