19 declare(strict_types=1);
21 require_once(
'libs/composer/vendor/autoload.php');
22 include_once(
'./tests/UI/UITestHelper.php');
47 $this->messageStringTwo,
53 $this->messageStringThree,
59 $this->assertTrue($this->messages[0]->getMessage() === $this->messageStringThree);
62 $this->assertTrue($this->messages[1]->getMessage() === $this->messageStringTwo);
65 $this->assertTrue($this->messages[2]->getMessage() === $this->messageStringOne);
76 $this->messageStringTwo,
82 $this->messageStringThree,
88 $this->assertTrue($this->messages[2]->getMessage() === $this->messageStringThree);
91 $this->assertTrue($this->messages[1]->getMessage() === $this->messageStringTwo);
94 $this->assertTrue($this->messages[0]->getMessage() === $this->messageStringOne);
105 $this->messageStringTwo,
111 'Another SUCCESS message',
117 $this->messageStringThree,
123 'Another ERROR message',
129 'YET another ERROR message',
137 '</br>' .
'Another SUCCESS message' .
'</br>');
139 '</br>' .
'Another ERROR message' .
'</br>' .
'YET another ERROR message' .
'</br>');
149 $this->messageStringTwo,
155 'Another SUCCESS message',
161 $this->messageStringThree,
167 'Another ERROR message',
173 'YET another ERROR message',
182 $this->assertCount(3, $message_components);
183 $this->assertInstanceOf(IMessageBox::class, $message_components[0]);
184 $this->assertInstanceOf(IMessageBox::class, $message_components[1]);
185 $this->assertInstanceOf(IMessageBox::class, $message_components[2]);
187 $this->assertEquals(
ILIAS\
UI\
Component\MessageBox\MessageBox::INFO, $message_components[0]->getType());
188 $this->assertEquals(
ILIAS\
UI\
Component\MessageBox\MessageBox::SUCCESS, $message_components[1]->getType());
189 $this->assertEquals(
ILIAS\
UI\
Component\MessageBox\MessageBox::FAILURE, $message_components[2]->getType());
191 $this->assertEquals(
'This is a message</br>', $message_components[0]->getMessageText());
201 $this->messageStringTwo,
225 $this->messageStringOne,
229 $this->getMockBuilder(ilGlobalTemplateInterface::class)->getMock()
testGetUIComponentsMessages()
Class ChatMainBarProvider .
hasMessages()
Return wheter there are any message at all stored in the stack.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilSystemStyleMessage $ilSystemStyleMessage
addMessage(ilSystemStyleMessage $message)
Add a message to be displayed by the stack.
prependMessage(ilSystemStyleMessage $message)
Add a message to be displayed before all others.
string $messageStringThree
getUIComponentsMessages(\ILIAS\UI\Factory $f)
Return Messages as UI Component.
ilSystemStyleMessageStack $ilSystemStyleMessageStack
Used to stack messages to be shown to the user.
getJoinedMessages()
Return an array containing a string with all messages for each type.
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...