function PathPluginBaseTest::setupContainer

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\display\PathPluginBaseTest::setupContainer()
  2. 10 core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\display\PathPluginBaseTest::setupContainer()
  3. 11.x core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\display\PathPluginBaseTest::setupContainer()

Setup access plugin manager and config factory in the Drupal class.

1 call to PathPluginBaseTest::setupContainer()
PathPluginBaseTest::setUp in core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php

File

core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php, line 67

Class

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

Namespace

Drupal\Tests\views\Unit\Plugin\display

Code

public function setupContainer() {
    $this->accessPluginManager = $this->getMockBuilder('\\Drupal\\views\\Plugin\\ViewsPluginManager')
        ->disableOriginalConstructor()
        ->getMock();
    $container = new ContainerBuilder();
    $container->set('plugin.manager.views.access', $this->accessPluginManager);
    $config = [
        'views.settings' => [
            'skip_cache' => TRUE,
            'display_extenders' => [],
        ],
    ];
    $container->set('config.factory', $this->getConfigFactoryStub($config));
    \Drupal::setContainer($container);
}

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