LocaleLocalTasksTest.php

Same filename and directory in other branches
  1. 9 core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php
  2. 8.9.x core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php
  3. 10 core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php

Namespace

Drupal\Tests\locale\Unit\Menu

File

core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\locale\Unit\Menu;

use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;

/**
 * Tests locale local tasks.
 *
 * @group locale
 */
class LocaleLocalTasksTest extends LocalTaskIntegrationTestBase {
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        $this->directoryList = [
            'locale' => 'core/modules/locale',
        ];
        parent::setUp();
    }
    
    /**
     * Checks locale listing local tasks.
     *
     * @dataProvider getLocalePageRoutes
     */
    public function testLocalePageLocalTasks($route) : void {
        $tasks = [
            0 => [
                'locale.translate_page',
                'locale.translate_import',
                'locale.translate_export',
                'locale.settings',
            ],
        ];
        $this->assertLocalTasks($route, $tasks);
    }
    
    /**
     * Provides a list of routes to test.
     */
    public static function getLocalePageRoutes() {
        return [
            [
                'locale.translate_page',
            ],
            [
                'locale.translate_import',
            ],
            [
                'locale.translate_export',
            ],
            [
                'locale.settings',
            ],
        ];
    }

}

Classes

Title Deprecated Summary
LocaleLocalTasksTest Tests locale local tasks.

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