function TestMessenger::messagesByType
Gets all messages of a certain type.
Parameters
string $type: The messages' type. Either self::TYPE_STATUS, self::TYPE_WARNING, or self::TYPE_ERROR.
Return value
string[]|\Drupal\Component\Render\MarkupInterface[] The messages of given type.
Overrides MessengerInterface::messagesByType
File
-
tests/
src/ Unit/ TestMessenger.php, line 62
Class
- TestMessenger
- Mock class to replace the messenger service in unit tests.
Namespace
Drupal\Tests\rules\UnitCode
public function messagesByType($type) {
if (!empty($type)) {
return $this->messages[$type] ?? [];
}
}