You are here

public function LingotekProfileFormTest::testDefaultProfilesPresent in Lingotek Translation 3.6.x

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

Test that default profiles are present.

File

tests/src/Functional/Form/LingotekProfileFormTest.php, line 46

Class

LingotekProfileFormTest
Tests the Lingotek profile form.

Namespace

Drupal\Tests\lingotek\Functional\Form

Code

public function testDefaultProfilesPresent() {
  $assert_session = $this
    ->assertSession();
  $this
    ->drupalGet('admin/lingotek/settings');

  // Status of the checkbox matrix is as expected.
  $this
    ->assertFieldChecked('edit-profile-automatic-auto-upload');
  $this
    ->assertFieldChecked('edit-profile-automatic-auto-download');
  $this
    ->assertNoFieldChecked('edit-profile-manual-auto-upload');
  $this
    ->assertNoFieldChecked('edit-profile-manual-auto-download');
  $this
    ->assertNoFieldChecked('edit-profile-disabled-auto-upload');
  $this
    ->assertNoFieldChecked('edit-profile-disabled-auto-download');

  // We cannot edit them.
  $assert_session
    ->linkByHrefNotExists('/admin/lingotek/settings/profile/automatic/edit');
  $assert_session
    ->linkByHrefNotExists('/admin/lingotek/settings/profile/manual/edit');
  $assert_session
    ->linkByHrefNotExists('/admin/lingotek/settings/profile/disabled/edit');

  // The fields are disabled.
  $this
    ->assertFieldDisabled('edit-profile-automatic-auto-upload');
  $this
    ->assertFieldDisabled('edit-profile-automatic-auto-download');
  $this
    ->assertFieldDisabled('edit-profile-manual-auto-upload');
  $this
    ->assertFieldDisabled('edit-profile-manual-auto-download');
  $this
    ->assertFieldDisabled('edit-profile-disabled-auto-upload');
  $this
    ->assertFieldDisabled('edit-profile-disabled-auto-download');
}