public function TestMessenger::deleteByType in Rules 8.3
Deletes 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 deleted messages of given type.
Overrides MessengerInterface::deleteByType
File
- tests/
src/ Unit/ TestMessenger.php, line 78
Class
- TestMessenger
- Mock class to replace the messenger service in unit tests.
Namespace
Drupal\Tests\rules\UnitCode
public function deleteByType($type) {
if (!empty($type) && isset($this->messages[$type])) {
$this->messages[$type] = NULL;
}
}