library_manager-8.x-1.0/tests/src/Unit/LocalTasksTest.php

tests/src/Unit/LocalTasksTest.php
<?php

namespace Drupal\Tests\library_manager\Unit;

use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;

/**
 * Tests Library manager local tasks.
 *
 * @group library_manager
 */
class LocalTasksTest extends LocalTaskIntegrationTestBase {

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    // The module can be located in subdirectory.
    preg_match('#.*/(modules/.*library_manager)/tests/src/Unit$#', __DIR__, $matches);
    $this->directoryList = ['library_manager' => $matches[1]];
    parent::setUp();
  }

  /**
   * Tests local task existence.
   */
  public function testActionLocalTasks() {
    $this->assertLocalTasks(
      'library_manager.library_collection',
      [
        [
          'library_manager.libraries',
          'library_manager.entity.library_definition.collection',
          'library_manager.settings',
        ],
      ]
    );
    $this->assertLocalTasks(
      'library_manager.library_canonical',
      [
        [
          'library_manager.library_canonical',
          'library_manager.library_export',
        ],
      ]
    );
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc