You are here

protected function PathPluginBaseTest::setupViewExecutableAccessPlugin in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\display\PathPluginBaseTest::setupViewExecutableAccessPlugin()

Returns some mocked view entity, view executable, and access plugin.

14 calls to PathPluginBaseTest::setupViewExecutableAccessPlugin()
PathPluginBaseTest::testAlterPostRestRoute in core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php
Tests the altering of a REST route.
PathPluginBaseTest::testAlterRoute in core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php
Tests the alter route method.
PathPluginBaseTest::testAlterRoutesWithOptionalParameters in core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php
Tests altering routes with optional parameters in the overridden route.
PathPluginBaseTest::testAlterRoutesWithParameters in core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php
Tests altering routes with parameters in the overridden route.
PathPluginBaseTest::testAlterRoutesWithParametersAndUpcasting in core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php
Tests altering routes with parameters and upcasting information

... See full list

File

core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php, line 544
Contains \Drupal\Tests\views\Unit\Plugin\display\PathPluginBaseTest.

Class

PathPluginBaseTest
@coversDefaultClass \Drupal\views\Plugin\views\display\PathPluginBase @group views

Namespace

Drupal\Tests\views\Unit\Plugin\display

Code

protected function setupViewExecutableAccessPlugin() {
  $view_entity = $this
    ->getMockBuilder('Drupal\\views\\Entity\\View')
    ->disableOriginalConstructor()
    ->getMock();
  $view_entity
    ->expects($this
    ->any())
    ->method('id')
    ->will($this
    ->returnValue('test_id'));
  $view = $this
    ->getMockBuilder('Drupal\\views\\ViewExecutable')
    ->disableOriginalConstructor()
    ->getMock();
  $view
    ->expects($this
    ->any())
    ->method('getTitle')
    ->willReturn('my views title');
  $view->storage = $view_entity;

  // Skip views options caching.
  $view->editing = TRUE;
  $access_plugin = $this
    ->getMockBuilder('Drupal\\views\\Plugin\\views\\access\\AccessPluginBase')
    ->disableOriginalConstructor()
    ->getMockForAbstractClass();
  $this->accessPluginManager
    ->expects($this
    ->any())
    ->method('createInstance')
    ->will($this
    ->returnValue($access_plugin));
  return [
    $view,
    $view_entity,
    $access_plugin,
  ];
}