You are here

public function LingotekAccountTest::testHandshakePage in Lingotek Translation 3.7.x

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

File

tests/src/Functional/LingotekAccountTest.php, line 70

Class

LingotekAccountTest
Tests the Lingotek dashboard.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testHandshakePage() {
  $assert_session = $this
    ->assertSession();

  // We avoid the redirect so we can see where the user will land for some
  // seconds.
  \Drupal::state()
    ->set('authorize_no_redirect', TRUE);

  // Login as admin.
  $this
    ->drupalLogin($this->rootUser);

  // Try to navigate to the Dashboard page, and assert we are redirected.
  $this
    ->drupalGet('admin/lingotek/setup/account');

  // Fake the connection to an account in Lingotek.
  $this
    ->clickLink('Connect Lingotek Account');

  // Our fake backend generates a token, returns to the site and waits for the
  // redirect.
  // $this->assertText('Connecting... Please wait to be redirected');
  $assert_session
    ->addressEquals('admin/lingotek/setup/account');
}