You are here

public function LingotekSettingsTabContentFormTest::testAddContentTypeAndConfigureLingotekToTranslate in Lingotek Translation 3.8.x

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

File

tests/src/Functional/Form/LingotekSettingsTabContentFormTest.php, line 418

Class

LingotekSettingsTabContentFormTest
Tests the Lingotek content settings form.

Namespace

Drupal\Tests\lingotek\Functional\Form

Code

public function testAddContentTypeAndConfigureLingotekToTranslate() {

  // Check the form contains the article type and only its text-based fields.
  $this
    ->drupalGet('admin/structure/types');
  $this
    ->clickLink('Add content type');
  $this
    ->assertNoFieldChecked('language_configuration[language_alterable]');
  $this
    ->assertNoFieldChecked('language_configuration[content_translation]');
  $this
    ->assertNoFieldChecked('language_configuration[content_translation_for_lingotek]');
  $edit = [
    'name' => 'Test',
    'type' => 'test',
    'language_configuration[language_alterable]' => TRUE,
    'language_configuration[content_translation]' => TRUE,
    'language_configuration[content_translation_for_lingotek]' => TRUE,
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Save and manage fields');
  $this
    ->assertText('The content type Test has been added.');

  // It should result that the field is enabled in Lingotek settings.
  $this
    ->drupalGet('admin/lingotek/settings');
  $this
    ->assertFieldChecked('edit-node-test-enabled');

  // We automatically enabled sensible defaults fields according to their type.
  $this
    ->assertFieldChecked('edit-node-test-fields-title');
  $this
    ->assertFieldChecked('edit-node-test-fields-body');
  $this
    ->assertNoFieldChecked('edit-node-test-fields-uid');
}