public function TestMessenger::messagesByType in Ubercart 8.4
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
- uc_cart_links/
tests/ src/ Unit/ TestMessenger.php, line 57
Class
- TestMessenger
- Mock class to replace the messenger service in unit tests.
Namespace
Drupal\Tests\uc_cart_links\UnitCode
public function messagesByType($type) {
if (!empty($type)) {
return isset($this->messages[$type]) ? $this->messages[$type] : [];
}
}