You are here

public function LingotekDashboardTest::testDashboardEndpointUrlIsRelative in Lingotek Translation 3.1.x

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

Ensure endpoint url is relative.

File

tests/src/Functional/LingotekDashboardTest.php, line 581

Class

LingotekDashboardTest
Tests the Lingotek dashboard.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testDashboardEndpointUrlIsRelative() {
  $basepath = \Drupal::request()
    ->getBasePath();
  $this
    ->drupalGet('/admin/lingotek');
  $drupalSettings = $this
    ->getDrupalSettings();

  // Using an absolute url can be problematic in https environments, ensure we
  // use a relative one.
  $this
    ->assertEquals($basepath . '/admin/lingotek/dashboard_endpoint', $drupalSettings['lingotek']['cms_data']['endpoint_url']);
}