You are here

public function TestMessenger::addWarning in Ubercart 8.4

Adds a new warning message to the queue.

Parameters

string|\Drupal\Component\Render\MarkupInterface $message: (optional) The translated message to be displayed to the user. For consistency with other messages, it should begin with a capital letter and end with a period.

bool $repeat: (optional) If this is FALSE and the message is already set, then the message won't be repeated. Defaults to FALSE.

Return value

$this

Overrides MessengerInterface::addWarning

File

uc_cart_links/tests/src/Unit/TestMessenger.php, line 43

Class

TestMessenger
Mock class to replace the messenger service in unit tests.

Namespace

Drupal\Tests\uc_cart_links\Unit

Code

public function addWarning($message, $repeat = FALSE) {
  return $this
    ->addMessage($message, static::TYPE_WARNING, $repeat);
}