Commit 7353b6f1 authored by alexpott's avatar alexpott

Issue #2952634 by Sut3kh, alexpott, Rob C, jibran:...

Issue #2952634 by Sut3kh, alexpott, Rob C, jibran: LegacyMessenger::deleteByType does not delete anything
parent 1e8a4de6
......@@ -180,7 +180,7 @@ public function deleteAll() {
public function deleteByType($type) {
// Proxy to the Messenger service, if it exists.
if ($messenger = $this->getMessengerService()) {
return $messenger->messagesByType($type);
return $messenger->deleteByType($type);
}
$messages = static::$messages[$type];
......
......@@ -424,7 +424,7 @@ public function testErrorMessagesAreNotChanged() {
// after calling _file_save_upload_from_form() are correct.
$this->assertText($error);
$this->assertRaw('Number of error messages before _file_save_upload_from_form(): 1');
$this->assertRaw('Number of error messages after _file_save_upload_from_form(): 2');
$this->assertRaw('Number of error messages after _file_save_upload_from_form(): 1');
// Test a successful upload with no messages.
$edit = [
......
......@@ -103,6 +103,11 @@ public function testMessages() {
$this->assertCount(4, $messages[MessengerInterface::TYPE_STATUS]);
$this->assertCount(4, $messages[MessengerInterface::TYPE_WARNING]);
$this->assertCount(4, $messages[MessengerInterface::TYPE_ERROR]);
// Test deleteByType().
$this->assertCount(4, $messenger->deleteByType(MessengerInterface::TYPE_WARNING));
$this->assertCount(0, $messenger->messagesByType(MessengerInterface::TYPE_WARNING));
$this->assertCount(4, $messenger->messagesByType(MessengerInterface::TYPE_ERROR));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment