function ViewsLocalTaskTest::setUpMockRouteProvider

Reinitializes the route provider as a mock object.

1 call to ViewsLocalTaskTest::setUpMockRouteProvider()
ViewsLocalTaskTest::testGetDerivativeDefinitionsWithExistingLocalTask in core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
Tests fetching the derivatives on a view with a local task and a parent.

File

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

Class

ViewsLocalTaskTest
Tests Drupal\views\Plugin\Derivative\ViewsLocalTask.

Namespace

Drupal\Tests\views\Unit\Plugin\Derivative

Code

protected function setUpMockRouteProvider() : void {
  $this->routeProvider = $this->createMock(RouteProviderInterface::class);
  $reflection = new \ReflectionProperty($this->localTaskDerivative, 'routeProvider');
  $reflection->setValue($this->localTaskDerivative, $this->routeProvider);
}

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