You are here

protected function ConfigSelectorTest::assertMessages in Configuration selector 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/ConfigSelectorTest.php \Drupal\Tests\config_selector\Kernel\ConfigSelectorTest::assertMessages()

Asserts the Drupal message service has messages.

Parameters

array $messages: (optional) The messages we expect the Drupal message service to have. Defaults to an empty array.

string $type: (optional) The type of the expected messages. Defaults to 'status'.

2 calls to ConfigSelectorTest::assertMessages()
ConfigSelectorTest::testConfigSelector in tests/src/Kernel/ConfigSelectorTest.php
Tests \Drupal\config_selector\ConfigSelector().
ConfigSelectorTest::testConfigSelectorIndirectDependency in tests/src/Kernel/ConfigSelectorTest.php
Tests \Drupal\config_selector\ConfigSelector().

File

tests/src/Kernel/ConfigSelectorTest.php, line 352

Class

ConfigSelectorTest
Tests the ConfigSelector.

Namespace

Drupal\Tests\config_selector\Kernel

Code

protected function assertMessages(array $messages = [], $type = 'status') {
  $actual_messages = drupal_get_messages($type);
  if (!empty($actual_messages)) {
    $actual_messages = array_map('strval', $actual_messages[$type]);
  }
  $this
    ->assertEquals($messages, $actual_messages);
}