class TestMessenger in Feeds extensible parsers 8
Stores messages without calling drupal_set_message().
Hierarchy
- class \Drupal\Core\Messenger\Messenger implements MessengerInterface
- class \Drupal\feeds_ex\Messenger\TestMessenger
Expanded class hierarchy of TestMessenger
8 files declare their use of TestMessenger
- HtmlParserTest.php in tests/
src/ Unit/ Feeds/ Parser/ HtmlParserTest.php - JmesPathLinesParserTest.php in tests/
src/ Unit/ Feeds/ Parser/ JmesPathLinesParserTest.php - JmesPathParserTest.php in tests/
src/ Unit/ Feeds/ Parser/ JmesPathParserTest.php - JsonPathLinesParserTest.php in tests/
src/ Unit/ Feeds/ Parser/ JsonPathLinesParserTest.php - JsonPathParserTest.php in tests/
src/ Unit/ Feeds/ Parser/ JsonPathParserTest.php
File
- src/
Messenger/ TestMessenger.php, line 10
Namespace
Drupal\feeds_ex\MessengerView source
class TestMessenger extends Messenger {
/**
* The messages that have been set.
*
* @var array
*/
protected $messages = [];
/**
* Constructs a new TestMessenger.
*/
public function __construct() {
}
/**
* {@inheritdoc}
*/
public function addMessage($message, $type = self::TYPE_STATUS, $repeat = FALSE) {
$this->messages[] = [
'message' => $message,
'type' => $type,
'repeat' => $repeat,
];
}
/**
* Returns the messages.
*
* This is used to inspect messages that have been set.
*
* @return array
* A list of message arrays.
*/
public function getMessages() {
return $this->messages;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Messenger:: |
protected | property | The flash bag. | |
Messenger:: |
protected | property | The kill switch. | |
Messenger:: |
public | function |
Adds a new error message to the queue. Overrides MessengerInterface:: |
|
Messenger:: |
public | function |
Adds a new status message to the queue. Overrides MessengerInterface:: |
|
Messenger:: |
public | function |
Adds a new warning message to the queue. Overrides MessengerInterface:: |
|
Messenger:: |
public | function |
Gets all messages. Overrides MessengerInterface:: |
|
Messenger:: |
public | function |
Deletes all messages. Overrides MessengerInterface:: |
|
Messenger:: |
public | function |
Deletes all messages of a certain type. Overrides MessengerInterface:: |
|
Messenger:: |
public | function |
Gets all messages of a certain type. Overrides MessengerInterface:: |
|
MessengerInterface:: |
constant | An error. | ||
MessengerInterface:: |
constant | A status message. | ||
MessengerInterface:: |
constant | A warning. | ||
TestMessenger:: |
protected | property | The messages that have been set. | |
TestMessenger:: |
public | function |
Adds a new message to the queue. Overrides Messenger:: |
|
TestMessenger:: |
public | function | Returns the messages. | |
TestMessenger:: |
public | function |
Constructs a new TestMessenger. Overrides Messenger:: |