19 declare(strict_types=1);
27 protected function setUp(): void
31 $component_factory = $this->getMockBuilder(ilComponentFactory::class)->getMock();
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 .
'-';
41 if ($key ===
'error3') {
42 return $key .
' (1. %s/2. %s/3. %s)';
58 'Exactly one error' => [
64 'error1<ul><li>error2</li></ul>' 66 'More than two errors with placeholders' => [
68 'error1<ul><li>error2</li><li>error3 (1. a/2. b/3. c)</li></ul>' 76 #[DataProvider('errorCollectionProvider')] 79 $this->assertSame($exteced_html, $this->
brutallyTrimHTML($this->error_formatter->format($errors)));
brutallyTrimHTML(string $html)
setGlobalVariable(string $name, $value)