You are here

public function EntityLegalDocumentVersionTestCase::testAdminOverviewUi in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 tests/entity_legal.version.test \EntityLegalDocumentVersionTestCase::testAdminOverviewUi()

Test the overview page contains a list of entities.

File

tests/entity_legal.version.test, line 25
Test for legal document version entity admin ui.

Class

EntityLegalDocumentVersionTestCase
Simpletest class for document versioning.

Code

public function testAdminOverviewUi() {

  // Create a document.
  $document = $this
    ->createDocument();

  // Create 3 documents versions.
  $versions = array();
  for ($i = 0; $i < 3; $i++) {
    $version = $this
      ->createDocumentVersion($document);
    $versions[] = $version;
  }
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('admin/structure/legal/manage/' . $document
    ->identifier());
  foreach ($versions as $version) {
    $this
      ->assertRaw($version
      ->label(), 'Legal document version found on overview page');
    $this
      ->assertLinkByHref('/admin/structure/legal/manage/' . $document
      ->identifier() . '/manage/' . $version
      ->identifier(), 0, 'Edit link for legal document version appears on overview');
  }
}