$this->messenger->
addStatus('Non Duplicated status message'
);
$this->messenger->
addStatus('Non Duplicated status message'
);
$this->
assertCount(1,
$this->messenger->
messagesByType(MessengerInterface::TYPE_STATUS
));
$this->messenger->
addWarning('Non Duplicated warning message'
);
$this->messenger->
addWarning('Non Duplicated warning message'
);
$this->
assertCount(1,
$this->messenger->
messagesByType(MessengerInterface::TYPE_WARNING
));
$this->messenger->
addError('Non Duplicated error message'
);
$this->messenger->
addError('Non Duplicated error message'
);
$messages =
$this->messenger->
messagesByType(MessengerInterface::TYPE_ERROR
);
$this->
assertCount(1,
$messages);
// Check getting all messages.
$messages =
$this->messenger->
all();
$this->
assertCount(3,
$messages);
$this->
assertArrayHasKey(MessengerInterface::TYPE_STATUS,
$messages);
$this->
assertArrayHasKey(MessengerInterface::TYPE_WARNING,
$messages);
$this->
assertArrayHasKey(MessengerInterface::TYPE_ERROR,
$messages);