You are here

protected function BlockTest::setUp in Drupal 9

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

Overrides UnitTestCase::setUp

File

core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php, line 37

Class

BlockTest
@coversDefaultClass \Drupal\views\Plugin\views\display\Block @group block

Namespace

Drupal\Tests\views\Unit\Plugin\views\display

Code

protected function setUp() : void {
  parent::setUp();
  $this->executable = $this
    ->getMockBuilder('Drupal\\views\\ViewExecutable')
    ->disableOriginalConstructor()
    ->setMethods([
    'executeDisplay',
    'setDisplay',
    'setItemsPerPage',
  ])
    ->getMock();
  $this->executable
    ->expects($this
    ->any())
    ->method('setDisplay')
    ->with('block_1')
    ->will($this
    ->returnValue(TRUE));
  $this->blockDisplay = $this->executable->display_handler = $this
    ->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\Block')
    ->disableOriginalConstructor()
    ->setMethods(NULL)
    ->getMock();
  $this->blockDisplay->view = $this->executable;
  $this->blockPlugin = $this
    ->getMockBuilder('Drupal\\views\\Plugin\\Block\\ViewsBlock')
    ->disableOriginalConstructor()
    ->getMock();
}