class TestViewsLocalTask

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php \Drupal\Tests\views\Unit\Plugin\Derivative\TestViewsLocalTask
  2. 10 core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php \Drupal\Tests\views\Unit\Plugin\Derivative\TestViewsLocalTask
  3. 11.x core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php \Drupal\Tests\views\Unit\Plugin\Derivative\TestViewsLocalTask

Replaces the applicable views call for easier testability.

Hierarchy

Expanded class hierarchy of TestViewsLocalTask

File

core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php, line 385

Namespace

Drupal\Tests\views\Unit\Plugin\Derivative
View source
class TestViewsLocalTask extends ViewsLocalTask {
    protected $result;
    
    /**
     * Sets applicable views result.
     */
    public function setApplicableMenuViews($result) {
        $this->result = $result;
    }
    
    /**
     * {@inheritdoc}
     */
    protected function getApplicableMenuViews() {
        return $this->result;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
TestViewsLocalTask::$result protected property
TestViewsLocalTask::getApplicableMenuViews protected function Return a list of all views and display IDs that have a menu entry. Overrides ViewsLocalTask::getApplicableMenuViews
TestViewsLocalTask::setApplicableMenuViews public function Sets applicable views result.
ViewsLocalTask::$routeProvider protected property The route provider.
ViewsLocalTask::$state protected property The state key value store.
ViewsLocalTask::$viewStorage protected property The view storage.
ViewsLocalTask::alterLocalTasks public function Alters base_route and parent_id into the views local tasks.
ViewsLocalTask::create public static function Creates a new class instance. Overrides ContainerDeriverInterface::create
ViewsLocalTask::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions
ViewsLocalTask::__construct public function Constructs a \Drupal\views\Plugin\Derivative\ViewsLocalTask instance.

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