Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / config_translation / tests / src / Functional / ConfigTranslationViewListUiTest.php
1 <?php
2
3 namespace Drupal\Tests\config_translation\Functional;
4
5 use Drupal\Tests\views_ui\Functional\UITestBase;
6
7 /**
8  * Visit view list and test if translate is available.
9  *
10  * @group config_translation
11  */
12 class ConfigTranslationViewListUiTest extends UITestBase {
13
14   /**
15    * Views used by this test.
16    *
17    * @var array
18    */
19   public static $testViews = ['node', 'test_view'];
20
21   /**
22    * Modules to enable.
23    *
24    * @var array
25    */
26   public static $modules = ['config_translation', 'views_ui'];
27
28   protected function setUp($import_test_views = TRUE) {
29     parent::setUp($import_test_views);
30
31     $permissions = [
32       'administer views',
33       'translate configuration',
34     ];
35
36     // Create and log in user.
37     $this->drupalLogin($this->drupalCreateUser($permissions));
38   }
39
40   /**
41    * Tests views_ui list to see if translate link is added to operations.
42    */
43   public function testTranslateOperationInViewListUi() {
44     // Views UI List 'admin/structure/views'.
45     $this->drupalGet('admin/structure/views');
46     $translate_link = 'admin/structure/views/view/test_view/translate';
47     // Test if the link to translate the test_view is on the page.
48     $this->assertLinkByHref($translate_link);
49
50     // Test if the link to translate actually goes to the translate page.
51     $this->drupalGet($translate_link);
52     $this->assertRaw('<th>' . t('Language') . '</th>');
53
54     // Test that the 'Edit' tab appears.
55     $this->assertLinkByHref('admin/structure/views/view/test_view');
56   }
57
58 }