public function LingotekSettingsTabAccountFormTest::testTableValues in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/Form/LingotekSettingsTabAccountFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabAccountFormTest::testTableValues()
 - 4.0.x tests/src/Functional/Form/LingotekSettingsTabAccountFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabAccountFormTest::testTableValues()
 - 3.0.x tests/src/Functional/Form/LingotekSettingsTabAccountFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabAccountFormTest::testTableValues()
 - 3.1.x tests/src/Functional/Form/LingotekSettingsTabAccountFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabAccountFormTest::testTableValues()
 - 3.2.x tests/src/Functional/Form/LingotekSettingsTabAccountFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabAccountFormTest::testTableValues()
 - 3.3.x tests/src/Functional/Form/LingotekSettingsTabAccountFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabAccountFormTest::testTableValues()
 - 3.4.x tests/src/Functional/Form/LingotekSettingsTabAccountFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabAccountFormTest::testTableValues()
 - 3.5.x tests/src/Functional/Form/LingotekSettingsTabAccountFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabAccountFormTest::testTableValues()
 - 3.7.x tests/src/Functional/Form/LingotekSettingsTabAccountFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabAccountFormTest::testTableValues()
 - 3.8.x tests/src/Functional/Form/LingotekSettingsTabAccountFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabAccountFormTest::testTableValues()
 
Test the table shows the right values.
File
- tests/
src/ Functional/ Form/ LingotekSettingsTabAccountFormTest.php, line 34  
Class
- LingotekSettingsTabAccountFormTest
 - Tests the Lingotek account settings form.
 
Namespace
Drupal\Tests\lingotek\Functional\FormCode
public function testTableValues() {
  $this
    ->drupalGet('admin/lingotek/settings');
  $this
    ->assertTableValue('status', 'Active');
  $this
    ->assertTableValue('plan', 'No');
  $this
    ->assertTableValue('activation', 'testUser@example.com');
  $this
    ->assertTableValue('token', FakeAuthorizationController::ACCESS_TOKEN);
  $this
    ->assertTableValue('community', 'Test community (test_community)');
  $this
    ->assertTableValue('workflow', 'Test workflow (test_workflow)');
  $this
    ->assertTableValue('project', 'Test project (test_project)');
  $this
    ->assertTableValue('vault', 'Test vault (test_vault)');
  $this
    ->assertTableValue('filter', 'Drupal Default (drupal_default)');
  $this
    ->assertTableValue('subfilter', 'Drupal Default (drupal_default)');
  $this
    ->assertTableValue('tms', \Drupal::request()
    ->getSchemeAndHttpHost() . \Drupal::request()
    ->getBasePath());
  $this
    ->assertTableValue('gmc', 'https://gmc.lingotek.com');
  $this
    ->clickLink('Edit defaults');
  $edit = [
    'community' => 'test_community2',
    'workflow' => 'test_workflow2',
    'project' => 'test_project2',
    'vault' => 'test_vault2',
    'filter' => 'test_filter2',
    'subfilter' => 'test_filter3',
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Save configuration');
  $this
    ->assertTableValue('status', 'Active');
  $this
    ->assertTableValue('plan', 'No');
  $this
    ->assertTableValue('activation', 'testUser@example.com');
  $this
    ->assertTableValue('token', FakeAuthorizationController::ACCESS_TOKEN);
  $this
    ->assertTableValue('community', 'Test community 2 (test_community2)');
  $this
    ->assertTableValue('workflow', 'Test workflow 2 (test_workflow2)');
  $this
    ->assertTableValue('project', 'Test project 2 (test_project2)');
  $this
    ->assertTableValue('vault', 'Test vault 2 (test_vault2)');
  $this
    ->assertTableValue('filter', 'Test filter 2 (test_filter2)');
  $this
    ->assertTableValue('subfilter', 'Test filter 3 (test_filter3)');
  $this
    ->assertTableValue('tms', \Drupal::request()
    ->getSchemeAndHttpHost() . \Drupal::request()
    ->getBasePath());
  $this
    ->assertTableValue('gmc', 'https://gmc.lingotek.com');
}