You are here

public function LingotekContentTypeBulkDebugTest::testDebugExport in Lingotek Translation 3.3.x

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

File

tests/src/Functional/LingotekContentTypeBulkDebugTest.php, line 63

Class

LingotekContentTypeBulkDebugTest
Tests debugging a config entity using the bulk management form.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testDebugExport() {

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

  // 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('node_type');
  $edit = [
    'table[article]' => TRUE,
    $this
      ->getBulkOperationFormName() => 'debug.export',
  ];
  $this
    ->drupalPostForm(NULL, $edit, $this
    ->getApplyActionsButtonLabel());
  $this
    ->assertText('Exports available');

  // Download the file.
  $this
    ->clickLink('config.node_type.json');
  $response = json_decode($this
    ->getSession()
    ->getPage()
    ->getContent(), TRUE);
  $this
    ->assertIdentical('Article', $response['node.type.article']['name']);
  $this
    ->assertIdentical(NULL, $response['node.type.article']['description']);
  $this
    ->assertIdentical(NULL, $response['node.type.article']['help']);
  $this
    ->assertIdentical('node_type (config): Article content type', $response['_debug']['title']);
  $this
    ->assertIdentical('automatic', $response['_debug']['profile']);
  $this
    ->assertIdentical('en_US', $response['_debug']['source_locale']);
}