function ViewsLocalTaskTest::setUpMockViewStorage

Reinitializes the view storage as a mock object.

5 calls to ViewsLocalTaskTest::setUpMockViewStorage()
ViewsLocalTaskTest::testGetDerivativeDefinitionsWithDefaultLocalTask in core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
Tests fetching the derivatives on a view with a default local task.
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.
ViewsLocalTaskTest::testGetDerivativeDefinitionsWithLocalTask in core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
Tests fetching the derivatives on a view with a default local task.
ViewsLocalTaskTest::testGetDerivativeDefinitionsWithoutLocalTask in core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
Tests fetching the derivatives on a view with without a local task.
ViewsLocalTaskTest::testGetDerivativeDefinitionsWithOverrideRoute in core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
Tests fetching the derivatives on a view which overrides an existing route.

File

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

Class

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

Namespace

Drupal\Tests\views\Unit\Plugin\Derivative

Code

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

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