setupContainer example


  protected function setUp(): void {
    parent::setUp();

    $this->routeProvider = $this->createMock('Drupal\Core\Routing\RouteProviderInterface');
    $this->state = $this->createMock('\Drupal\Core\State\StateInterface');
    $this->pathPlugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
      ->setConstructorArgs([[], 'path_base', []$this->routeProvider, $this->state])
      ->onlyMethods([])
      ->getMock();
    $this->setupContainer();
  }

  /** * Setup access plugin manager and config factory in the Drupal class. */
  public function setupContainer() {
    $this->accessPluginManager = $this->getMockBuilder('\Drupal\views\Plugin\ViewsPluginManager')
      ->disableOriginalConstructor()
      ->getMock();
    $container = new ContainerBuilder();
    $container->set('plugin.manager.views.access', $this->accessPluginManager);

    
Home | Imprint | This part of the site doesn't use cookies.