You are here

public function LingotekSystemSiteBulkDebugTest::testDebugExport in Lingotek Translation 8

File

src/Tests/LingotekSystemSiteBulkDebugTest.php, line 62

Class

LingotekSystemSiteBulkDebugTest
Tests debugging a config object using the bulk management form.

Namespace

Drupal\lingotek\Tests

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();
  $edit = [
    'table[system.site_information_settings]' => TRUE,
    // System information.
    'operation' => 'debug.export',
  ];
  $this
    ->drupalPostForm(NULL, $edit, t('Execute'));
  $this
    ->assertText('Exports available');

  // Download the file.
  $this
    ->clickLink('config.system.site_information_settings.json');
  $response = json_decode($this->content, true);
  $this
    ->assertIdentical('Drupal', $response['system.site']['name']);
  $this
    ->assertIdentical('', $response['system.site']['slogan']);
  $this
    ->assertIdentical('system.site_information_settings (config): System information', $response['_debug']['title']);
  $this
    ->assertIdentical('<null>', $response['_debug']['profile']);
  $this
    ->assertIdentical('en_US', $response['_debug']['source_locale']);
}