function AjaxCommandsTest::announceCommandProvider

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php \Drupal\Tests\Core\Ajax\AjaxCommandsTest::announceCommandProvider()
  2. 8.9.x core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php \Drupal\Tests\Core\Ajax\AjaxCommandsTest::announceCommandProvider()
  3. 11.x core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php \Drupal\Tests\Core\Ajax\AjaxCommandsTest::announceCommandProvider()

Data provider for testAnnounceCommand().

File

core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php, line 199

Class

AjaxCommandsTest
Test coverage for various classes in the \Drupal\Core\Ajax namespace.

Namespace

Drupal\Tests\Core\Ajax

Code

public static function announceCommandProvider() {
  return [
    'no priority' => [
      'Things are going to change!',
      NULL,
      [
        'command' => 'announce',
        'text' => 'Things are going to change!',
      ],
    ],
    'polite priority' => [
      'Things are going to change!',
      'polite',
      [
        'command' => 'announce',
        'text' => 'Things are going to change!',
        'priority' => AnnounceCommand::PRIORITY_POLITE,
      ],
    ],
    'assertive priority' => [
      'Important!',
      'assertive',
      [
        'command' => 'announce',
        'text' => 'Important!',
        'priority' => AnnounceCommand::PRIORITY_ASSERTIVE,
      ],
    ],
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.