LocalTasksTest.php in Twitter Profile Widget 8
File
tests/src/Unit/Menu/LocalTasksTest.php
View source
<?php
namespace Drupal\Tests\twitter_profile_widget\Unit\Menu;
use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
class LocalTasksTest extends LocalTaskIntegrationTestBase {
public function setUp() {
parent::setUp();
$module_path = str_replace(\Drupal::root(), '', __DIR__);
$module_path = str_replace('tests/src/Unit/Menu', '', $module_path);
$module_path = trim($module_path, '/');
$this->directoryList = [
'twitter_profile_widget' => $module_path,
];
}
public function testLocalTasksEntity($route) {
$tasks = [
0 => [
'entity.twitter_widget.canonical',
'entity.twitter_widget.edit_form',
'entity.twitter_widget.delete_form',
],
];
$this
->assertLocalTasks($route, $tasks);
}
public function getPageRoutesEntity() {
return [
[
'entity.twitter_widget.canonical',
],
[
'entity.twitter_widget.edit_form',
],
[
'entity.twitter_widget.delete_form',
],
];
}
}
Classes
Name |
Description |
LocalTasksTest |
Tests whether Twitter Profile Widget local tasks work correctly. |