You are here

protected function LingotekTestBase::assertManagementFormProfile in Lingotek Translation 3.8.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertManagementFormProfile()
  2. 4.0.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertManagementFormProfile()
  3. 3.0.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertManagementFormProfile()
  4. 3.1.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertManagementFormProfile()
  5. 3.2.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertManagementFormProfile()
  6. 3.3.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertManagementFormProfile()
  7. 3.4.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertManagementFormProfile()
  8. 3.5.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertManagementFormProfile()
  9. 3.6.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertManagementFormProfile()
  10. 3.7.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertManagementFormProfile()

Asserts a given index of the management table shows a given profile.

Parameters

int $index: The index of the table to check.

string|null $profile: The profile to verify.

1 call to LingotekTestBase::assertManagementFormProfile()
LingotekNodeBulkFormTest::testDefaultProfile in tests/src/Functional/Form/LingotekNodeBulkFormTest.php
Tests default profile is shown in the content management page.

File

tests/src/Functional/LingotekTestBase.php, line 262

Class

LingotekTestBase
Base class for Lingotek test. Performs authorization of the account.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function assertManagementFormProfile($index, $profile) {
  $elements = $this
    ->xpath("//*[@id='edit-table']/tbody/tr[{$index}]/td[6]");
  if ($profile === NULL) {
    $this
      ->assertEqual(0, count($elements), "Profile for {$index} is shown as empty");
  }
  else {
    $shown_profile = $elements[0]
      ->getHtml();
    $this
      ->assertEqual($profile, $shown_profile, "Profile for {$index} is shown as {$profile}");
  }
}