<?php

declare(strict_types=1);

namespace Drupal\Tests\locale\Unit\Menu;

use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;

/**
 * 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'],
    ];
  }

}
