LocaleTranslateStringTourTest.php

Same filename in other branches
  1. 9 core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php
  2. 8.9.x core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php
  3. 10 core/modules/tour/tests/src/Functional/Locale/LocaleTranslateStringTourTest.php

Namespace

Drupal\Tests\tour\Functional\Locale

File

core/modules/tour/tests/src/Functional/Locale/LocaleTranslateStringTourTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\tour\Functional\Locale;

use Drupal\Tests\tour\Functional\TourTestBase;

/**
 * Tests the Translate Interface tour.
 *
 * @group tour
 * @group legacy
 */
class LocaleTranslateStringTourTest extends TourTestBase {
    
    /**
     * An admin user with administrative permissions to translate.
     *
     * @var \Drupal\user\UserInterface
     */
    protected $adminUser;
    
    /**
     * Modules to enable.
     *
     * @var array
     */
    protected static $modules = [
        'locale',
        'tour',
    ];
    
    /**
     * {@inheritdoc}
     */
    protected $defaultTheme = 'stark';
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        parent::setUp();
        $this->adminUser = $this->drupalCreateUser([
            'translate interface',
            'access tour',
            'administer languages',
        ]);
        $this->drupalLogin($this->adminUser);
    }
    
    /**
     * Tests locale tour tip availability.
     */
    public function testTranslateStringTourTips() {
        // Add another language so there are no missing form items.
        $edit = [];
        $edit['predefined_langcode'] = 'es';
        $this->drupalGet('admin/config/regional/language/add');
        $this->submitForm($edit, 'Add language');
        $this->drupalGet('admin/config/regional/translate');
        $this->assertTourTips();
    }

}

Classes

Title Deprecated Summary
LocaleTranslateStringTourTest Tests the Translate Interface tour.

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