You are here

protected function BlockTest::setUp in Zircon Profile 8.0

Same name in this branch
  1. 8.0 core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php \Drupal\Tests\views\Unit\Plugin\views\display\BlockTest::setUp()
  2. 8.0 core/modules/block/tests/src/Unit/Plugin/migrate/source/BlockTest.php \Drupal\Tests\block\Unit\Plugin\migrate\source\BlockTest::setUp()
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 42
Contains \Drupal\Tests\views\Unit\Plugin\views\display\BlockTest.

Class

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

Namespace

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

Code

protected function setUp() {
  parent::setUp();
  $this->executable = $this
    ->getMockBuilder('Drupal\\views\\ViewExecutable')
    ->disableOriginalConstructor()
    ->setMethods(array(
    '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();
}