You are here

public function DrushCommandsTest::testCreateMinimalDelete in Site Alert 8

Tests site-alert:create minimal.

File

tests/src/Functional/DrushCommandsTest.php, line 49

Class

DrushCommandsTest
Execute drush commands on site_alert.

Namespace

Drupal\Tests\site_alert\Functional

Code

public function testCreateMinimalDelete() : void {
  $label = 'automated-test-alert';
  $message = 'A site alert test.';
  $this
    ->drush('site-alert:create', [
    $label,
    $message,
  ]);
  $this
    ->assertErrorOutputEquals("[success] Created site alert 'automated-test-alert'.");
  $this
    ->assertAlertCount(1);
  $this
    ->assertAlertByLabel($label, $message);
  $this
    ->drush('site-alert:delete', [
    $label,
  ]);
  $this
    ->assertErrorOutputEquals("[success] Deleted 1 site alerts labelled 'automated-test-alert'.");
  $this
    ->assertAlertCount(0);
}