You are here

public function LingotekManageLingotekTranslationsPermissionTest::testDashboardAsTranslationsManager in Lingotek Translation 3.2.x

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

Tests dashboard works as a translations manager.

File

tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php, line 175

Class

LingotekManageLingotekTranslationsPermissionTest
Tests different permissions of the Lingotek module.

Namespace

Drupal\Tests\lingotek\Functional

Code

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

  // Login as translations manager.
  $this
    ->drupalLogin($this->translationManagerUser);

  // Check the stats.
  $request = $this
    ->drupalGet(Url::fromRoute('lingotek.dashboard_endpoint', [], [
    'absolute' => TRUE,
  ]));
  $response = json_decode($request, TRUE);
  $this
    ->verbose(var_export($response, TRUE));
  $this
    ->assertIdentical('GET', $response['method']);
  $this
    ->assertIdentical(2, $response['count']);
  $this
    ->assertIdentical('en', $response['languages']['en_US']['xcode']);
  $this
    ->assertIdentical(1, $response['languages']['en_US']['active']);
  $this
    ->assertIdentical(1, $response['languages']['en_US']['enabled']);
  $this
    ->assertIdentical('es', $response['languages']['es_ES']['xcode']);
  $this
    ->assertIdentical(1, $response['languages']['es_ES']['active']);
  $this
    ->assertIdentical(1, $response['languages']['es_ES']['enabled']);
}