You are here

public function LingotekConnectTest::testConnectToLingotekWithoutFilters in Lingotek Translation 3.7.x

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

Tests connecting to Lingotek.

File

tests/src/Functional/Form/LingotekConnectTest.php, line 84

Class

LingotekConnectTest
Class for testing connecting to Lingotek.

Namespace

Drupal\Tests\lingotek\Functional\Form

Code

public function testConnectToLingotekWithoutFilters() {
  $assert_session = $this
    ->assertSession();
  \Drupal::state()
    ->set('lingotek.no_filters', TRUE);
  $this
    ->drupalGet('admin/lingotek/setup/account');
  $this
    ->clickLink('Connect Lingotek Account');
  $this
    ->drupalPostForm(NULL, [
    'community' => 'test_community',
  ], 'Next');
  $this
    ->assertText('The configuration options have been saved.');

  // Assert there are options for workflows.
  $this
    ->assertFieldByName('workflow');
  $option_field = $assert_session
    ->optionExists('edit-workflow', '- Select -');
  $this
    ->assertTrue($option_field
    ->hasAttribute('selected'));
  $assert_session
    ->optionExists('edit-workflow', 'test_workflow');
  $assert_session
    ->optionExists('edit-workflow', 'test_workflow2');

  // Assert there are no options for filters and no select.
  $this
    ->assertNoFieldByName('filter');
  $this
    ->assertNoFieldByName('subfilter');
  $this
    ->drupalPostForm(NULL, [
    'project' => 'test_project',
    'workflow' => 'test_workflow',
    'vault' => 'test_vault',
  ], 'Save configuration');
  $this
    ->assertText('The configuration options have been saved.');
}