function ConfigTranslationViewListUiTest::testTranslateOperationInViewListUi

Same name and namespace in other branches
  1. 9 core/modules/config_translation/tests/src/Functional/ConfigTranslationViewListUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationViewListUiTest::testTranslateOperationInViewListUi()
  2. 8.9.x core/modules/config_translation/tests/src/Functional/ConfigTranslationViewListUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationViewListUiTest::testTranslateOperationInViewListUi()
  3. 11.x core/modules/config_translation/tests/src/Functional/ConfigTranslationViewListUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationViewListUiTest::testTranslateOperationInViewListUi()

Tests views_ui list to see if translate link is added to operations.

File

core/modules/config_translation/tests/src/Functional/ConfigTranslationViewListUiTest.php, line 57

Class

ConfigTranslationViewListUiTest
Visit view list and test if translate is available.

Namespace

Drupal\Tests\config_translation\Functional

Code

public function testTranslateOperationInViewListUi() : void {
  // Views UI List 'admin/structure/views'.
  $this->drupalGet('admin/structure/views');
  $translate_link = 'admin/structure/views/view/test_view/translate';
  // Test if the link to translate the test_view is on the page.
  $this->assertSession()
    ->linkByHrefExists($translate_link);
  // Test if the link to translate actually goes to the translate page.
  $this->drupalGet($translate_link);
  $this->assertSession()
    ->responseContains('<th>Language</th>');
  // Test that the 'Edit' tab appears.
  $this->assertSession()
    ->linkByHrefExists('admin/structure/views/view/test_view');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.