function BlockTest::testBuildOverride

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

Tests the build method with overriding items per page.

File

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

Class

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

Namespace

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

Code

public function testBuildOverride() : void {
    $this->executable
        ->expects($this->once())
        ->method('setItemsPerPage')
        ->with(5);
    $this->blockPlugin
        ->expects($this->once())
        ->method('getConfiguration')
        ->willReturn([
        'items_per_page' => 5,
    ]);
    $this->blockDisplay
        ->preBlockBuild($this->blockPlugin);
}

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