LanguageLocalTasksTest.php 1.45 KB
Newer Older
1 2 3 4
<?php

/**
 * @file
5
 * Contains \Drupal\language\Tests\Menu\LanguageLocalTasksTest.
6 7 8 9 10 11 12 13 14 15 16 17
 */

namespace Drupal\language\Tests\Menu;

use Drupal\Tests\Core\Menu\LocalTaskIntegrationTest;

/**
 * Tests existence of language local tasks.
 *
 * @group Drupal
 * @group language
 */
18
class LanguageLocalTasksTest extends LocalTaskIntegrationTest {
19 20 21 22 23 24 25 26 27 28

  public static function getInfo() {
    return array(
      'name' => 'Language local tasks test',
      'description' => 'Test existence of language local tasks.',
      'group' => 'Language',
    );
  }

  public function setUp() {
29 30
    $this->directoryList = array(
      'language' => 'core/modules/language',
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
    );
    parent::setUp();
  }

  /**
   * Tests language admin overview local tasks existence.
   *
   * @dataProvider getLanguageAdminOverviewRoutes
   */
  public function testLanguageAdminLocalTasks($route, $expected) {
    $this->assertLocalTasks($route, $expected);
  }

  /**
   * Provides a list of routes to test.
   */
  public function getLanguageAdminOverviewRoutes() {
    return array(
      array('language.admin_overview', array(array('language.admin_overview', 'language.negotiation'))),
      array('language.negotiation', array(array('language.admin_overview', 'language.negotiation'))),
    );
  }

  /**
   * Tests language edit local tasks existence.
   */
  public function testLanguageEditLocalTasks() {
    $this->assertLocalTasks('language.edit', array(
      0 => array('language.edit'),
    ));
  }

}