public function LingotekWorkbenchRedirectControllerTest::testWorkbenchLink in Lingotek Translation 3.1.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/Controller/LingotekWorkbenchRedirectControllerTest.php \Drupal\Tests\lingotek\Functional\Controller\LingotekWorkbenchRedirectControllerTest::testWorkbenchLink()
- 4.0.x tests/src/Functional/Controller/LingotekWorkbenchRedirectControllerTest.php \Drupal\Tests\lingotek\Functional\Controller\LingotekWorkbenchRedirectControllerTest::testWorkbenchLink()
- 3.0.x tests/src/Functional/Controller/LingotekWorkbenchRedirectControllerTest.php \Drupal\Tests\lingotek\Functional\Controller\LingotekWorkbenchRedirectControllerTest::testWorkbenchLink()
- 3.2.x tests/src/Functional/Controller/LingotekWorkbenchRedirectControllerTest.php \Drupal\Tests\lingotek\Functional\Controller\LingotekWorkbenchRedirectControllerTest::testWorkbenchLink()
- 3.3.x tests/src/Functional/Controller/LingotekWorkbenchRedirectControllerTest.php \Drupal\Tests\lingotek\Functional\Controller\LingotekWorkbenchRedirectControllerTest::testWorkbenchLink()
- 3.4.x tests/src/Functional/Controller/LingotekWorkbenchRedirectControllerTest.php \Drupal\Tests\lingotek\Functional\Controller\LingotekWorkbenchRedirectControllerTest::testWorkbenchLink()
- 3.5.x tests/src/Functional/Controller/LingotekWorkbenchRedirectControllerTest.php \Drupal\Tests\lingotek\Functional\Controller\LingotekWorkbenchRedirectControllerTest::testWorkbenchLink()
- 3.6.x tests/src/Functional/Controller/LingotekWorkbenchRedirectControllerTest.php \Drupal\Tests\lingotek\Functional\Controller\LingotekWorkbenchRedirectControllerTest::testWorkbenchLink()
- 3.7.x tests/src/Functional/Controller/LingotekWorkbenchRedirectControllerTest.php \Drupal\Tests\lingotek\Functional\Controller\LingotekWorkbenchRedirectControllerTest::testWorkbenchLink()
- 3.8.x tests/src/Functional/Controller/LingotekWorkbenchRedirectControllerTest.php \Drupal\Tests\lingotek\Functional\Controller\LingotekWorkbenchRedirectControllerTest::testWorkbenchLink()
Tests that the workbench link works.
File
- tests/
src/ Functional/ Controller/ LingotekWorkbenchRedirectControllerTest.php, line 60
Class
- LingotekWorkbenchRedirectControllerTest
- Tests the workbench redirect controller.
Namespace
Drupal\Tests\lingotek\Functional\ControllerCode
public function testWorkbenchLink() {
// We need this helper for setting the host.
$this
->drupalGet(Url::fromRoute('lingotek_test.fake_sethost'));
// Login as admin.
$this
->drupalLogin($this->rootUser);
// Create a node.
$edit = [];
$edit['title[0][value]'] = 'Llamas are cool';
$edit['body[0][value]'] = 'Llamas are very cool';
$edit['langcode[0][value]'] = 'en';
$this
->saveAndPublishNodeForm($edit);
// Go to the bulk management form.
$this
->goToContentBulkManagementForm();
// The document should have been automatically uploaded, so let's check
// the upload status.
$this
->clickLink('EN');
$this
->assertText('The import for node Llamas are cool is complete.');
// Request translation.
$this
->clickLink('ES');
$this
->assertText("Locale 'es_AR' was added as a translation target for node Llamas are cool.");
// Check translation status.
$this
->clickLink('ES');
$this
->assertText('The es_AR translation for node Llamas are cool is ready for download.');
// Download the Spanish translation.
$this
->assertLingotekDownloadTargetLink('es_AR');
$this
->clickLink('ES');
// Now the link is to the workbench, and it opens in a new tab.
$this
->assertLingotekWorkbenchLink('es_AR');
$expiration = FrozenTime::MY_BIRTHDAY + 60 * 30;
// Click the workbench tab.
$this
->clickLink('ES');
$basepath = \Drupal::request()
->getSchemeAndHttpHost();
$this
->assertUrl($basepath . '/workbench/document/dummy-document-hash-id/locale/es_AR');
}