You are here

public function EntityLegalDocumentTestCase::testDeleteForm in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 tests/entity_legal.document.test \EntityLegalDocumentTestCase::testDeleteForm()

Test the functionality of the delete form.

File

tests/entity_legal.document.test, line 139
Test file include for legal document.

Class

EntityLegalDocumentTestCase
Simpletest class for legal document entities.

Code

public function testDeleteForm() {
  $document = $this
    ->createDocument();
  $document_name = $document
    ->identifier();

  // Log in and check for existence of the created document.
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('admin/structure/legal');
  $this
    ->assertText($document_name, 'Document found in overview list');

  // Delete the document.
  $this
    ->drupalPost('admin/structure/legal/manage/' . $document_name . '/delete', array(), 'Confirm');

  // Ensure document no longer exists on the overview page.
  $this
    ->assertUrl('admin/structure/legal', array(), 'Returned to overview page after deletion');
  $this
    ->assertNoText($document_name, 'Document not found in overview list');
}