You are here

public function LingotekFieldBodyBulkDebugTest::testDebugOptionsDisplay in Lingotek Translation 8

Tests that a config can be exported using the debug options on the management page.

File

src/Tests/LingotekFieldBodyBulkDebugTest.php, line 49

Class

LingotekFieldBodyBulkDebugTest
Tests debugging a field using the bulk management form.

Namespace

Drupal\lingotek\Tests

Code

public function testDebugOptionsDisplay() {

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

  // Go to the bulk config management page.
  $this
    ->goToConfigBulkManagementForm();

  // There is no 'debug' option group.
  $this
    ->assertFalse($this
    ->xpath('//select[@id=:id]//optgroup[@label=:label]', array(
    ':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'));

  // Go to the bulk config management page.
  $this
    ->goToConfigBulkManagementForm();

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