You are here

class TestMessenger in Views XML Backend 8

The messenger used for tests.

Hierarchy

Expanded class hierarchy of TestMessenger

1 file declares its use of TestMessenger
XmlTest.php in tests/src/Unit/Plugin/views/query/XmlTest.php
Contains \Drupal\Tests\views_xml_backend\Unit\Plugin\views\query\XmlTest.

File

src/TestMessenger.php, line 13
Contains \Drupal\views_xml_backend\TestMessenger.

Namespace

Drupal\views_xml_backend
View source
class TestMessenger implements MessengerInterface {

  /**
   * A list of messages received.
   *
   * @var array
   */
  protected $messages = [];

  /**
   * {@inheritdoc}
   */
  public function setMessage($message = NULL, $type = 'status', $repeat = FALSE) {
    $this->messages[$type][] = (string) $message;
  }

  /**
   * Returns the messages that were sent keyed by message type.
   *
   * @return array
   *   The list of messages.
   */
  public function getMessages() {
    return $this->messages;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TestMessenger::$messages protected property A list of messages received.
TestMessenger::getMessages public function Returns the messages that were sent keyed by message type.
TestMessenger::setMessage public function Sets a message to display to the user. Overrides MessengerInterface::setMessage