public function LingotekManageLingotekTranslationsPermissionTest::testDashboardAsTranslationsManager in Lingotek Translation 3.0.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testDashboardAsTranslationsManager()
- 4.0.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testDashboardAsTranslationsManager()
- 3.1.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testDashboardAsTranslationsManager()
- 3.2.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testDashboardAsTranslationsManager()
- 3.3.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testDashboardAsTranslationsManager()
- 3.4.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testDashboardAsTranslationsManager()
- 3.5.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testDashboardAsTranslationsManager()
- 3.6.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testDashboardAsTranslationsManager()
- 3.7.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testDashboardAsTranslationsManager()
- 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\FunctionalCode
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']);
}