You are here

public function LingotekNodeBulkDebugTest::testDebugOptionsDisplay in Lingotek Translation 3.6.x

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

Tests that a node can be translated using the links on the management page.

File

tests/src/Functional/LingotekNodeBulkDebugTest.php, line 55

Class

LingotekNodeBulkDebugTest
Tests debugging a node using the bulk management form.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testDebugOptionsDisplay() {

  // Login as admin.
  $this
    ->drupalLogin($this->rootUser);
  $this
    ->goToContentBulkManagementForm();

  // There is no 'debug' option group.
  $this
    ->assertEmpty($this
    ->xpath('//select[@id=:id]//optgroup[@label=:label]', [
    ':id' => 'edit-operation',
    ':label' => 'debug',
  ]), 'There is no debug group.');

  // Enable the debug operations.
  $this
    ->drupalGet('admin/lingotek/settings');
  $this
    ->drupalPostForm(NULL, [], t('Enable debug operations'));

  // Back to the bulk node management page.
  $this
    ->goToContentBulkManagementForm();

  // There should be a 'debug' option group with the right operation.
  $this
    ->assertNotEmpty($this
    ->xpath('//select[@id=:id]//optgroup[@label=:label]', [
    ':id' => 'edit-operation',
    ':label' => 'debug',
  ]), 'There is a debug group.');
  $this
    ->assertNotEmpty($this
    ->xpath('//select[@id=:id]//option[@value=:value]', [
    ':id' => 'edit-operation',
    ':value' => 'debug.export',
  ]), 'There is a debug export option.');
}