You are here

public function BulkFormTest::testBulkDeletion in Contact Storage 8

Test multiple deletion.

File

tests/src/Functional/BulkFormTest.php, line 69

Class

BulkFormTest
Tests a contact message bulk form.

Namespace

Drupal\Tests\contact_storage\Functional

Code

public function testBulkDeletion() {
  $this
    ->drupalGet('contact');
  ViewTestData::createTestViews(get_class($this), [
    'contact_test_views',
  ]);

  // Check the operations are accessible to the administer permission user.
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'administer contact forms',
  ]));
  $this
    ->drupalGet('test-contact-message-bulk-form');
  $elements = $this
    ->xpath('//select[@id="edit-action"]//option');
  $this
    ->assertIdentical(count($elements), 1, 'All contact message operations are found.');
  $this
    ->drupalPostForm('test-contact-message-bulk-form', [], t('Apply to selected items'));
  $this
    ->assertText('No message selected.');
}