You are here

protected function HandlerTestTrait::setupExecutableAndView in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Unit/Plugin/HandlerTestTrait.php \Drupal\Tests\views\Unit\Plugin\HandlerTestTrait::setupExecutableAndView()
  2. 9 core/modules/views/tests/src/Unit/Plugin/HandlerTestTrait.php \Drupal\Tests\views\Unit\Plugin\HandlerTestTrait::setupExecutableAndView()

Sets up a view executable and a view entity.

1 call to HandlerTestTrait::setupExecutableAndView()
FieldTest::setUp in core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php

File

core/modules/views/tests/src/Unit/Plugin/HandlerTestTrait.php, line 41

Class

HandlerTestTrait
Test trait to mock dependencies of a handler.

Namespace

Drupal\Tests\views\Unit\Plugin

Code

protected function setupExecutableAndView() {
  $this->view = $this
    ->getMockBuilder('Drupal\\views\\Entity\\View')
    ->disableOriginalConstructor()
    ->getMock();
  $this->executable = $this
    ->getMockBuilder('Drupal\\views\\ViewExecutable')
    ->disableOriginalConstructor()
    ->getMock();
  $this->executable->storage = $this->view;
}