function ViewsLocalTaskTest::setUpMockState

Reinitializes the state as a mock object.

4 calls to ViewsLocalTaskTest::setUpMockState()
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::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 89

Class

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

Namespace

Drupal\Tests\views\Unit\Plugin\Derivative

Code

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

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