ConfigTranslationListUiTest.php
Same filename in this branch
Same filename and directory in other branches
- 11.x core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
- 10 core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
- 9 core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
- 8.9.x core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
- 11.x core/modules/contact/tests/src/Functional/ConfigTranslationListUiTest.php
- 11.x core/modules/shortcut/tests/src/Functional/ConfigTranslationListUiTest.php
Namespace
Drupal\Tests\shortcut\FunctionalFile
-
core/
modules/ shortcut/ tests/ src/ Functional/ ConfigTranslationListUiTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\shortcut\Functional;
use Drupal\shortcut\Entity\ShortcutSet;
use Drupal\Tests\BrowserTestBase;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
/**
* Ensure the "translate" link is added to shortcut sets.
*
* @see \Drupal\Tests\config_translation\Functional\ConfigTranslationListUiTest
*/
class ConfigTranslationListUiTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'block',
'config_translation',
'shortcut',
'toolbar',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$permissions = [
'administer shortcuts',
'translate configuration',
];
$this->drupalLogin($this->drupalCreateUser($permissions));
$this->config('locale.settings')
->set('translation.import_enabled', TRUE)
->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL)
->save();
$this->drupalPlaceBlock('local_tasks_block');
}
/**
* Tests the shortcut listing for the translate operation.
*/
public function testShortcutListTranslation() : void {
$shortcut = ShortcutSet::create([
'id' => $this->randomMachineName(16),
'label' => $this->randomString(),
]);
$shortcut->save();
$this->drupalGet('admin/config/user-interface/shortcut');
$translate_link = 'admin/config/user-interface/shortcut/manage/' . $shortcut->id() . '/translate';
$this->assertSession()
->linkByHrefExists($translate_link);
$this->drupalGet($translate_link);
$this->assertSession()
->responseContains('<th>Language</th>');
}
}
Classes
| Title | Deprecated | Summary |
|---|---|---|
| ConfigTranslationListUiTest | Ensure the "translate" link is added to shortcut sets. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.