TestViewsLocalTask example

/** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->routeProvider = $this->createMock('Drupal\Core\Routing\RouteProviderInterface');
    $this->state = $this->createMock('Drupal\Core\State\StateInterface');
    $this->viewStorage = $this->createMock('Drupal\Core\Entity\EntityStorageInterface');

    $this->localTaskDerivative = new TestViewsLocalTask($this->routeProvider, $this->state, $this->viewStorage);
  }

  /** * Tests fetching the derivatives on no view with hook menu. * * @see \Drupal\views\Plugin\Derivative\ViewsLocalTask::getDerivativeDefinitions() */
  public function testGetDerivativeDefinitionsWithoutHookMenuViews() {
    $result = [];
    $this->localTaskDerivative->setApplicableMenuViews($result);

    
Home | Imprint | This part of the site doesn't use cookies.