BlockItemsPerPageUpdateTest.php

Namespace

Drupal\Tests\views\Functional\Update

File

core/modules/views/tests/src/Functional/Update/BlockItemsPerPageUpdateTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\views\Functional\Update;

use Drupal\block\Entity\Block;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;

/**
 * @group Update
 * @covers views_post_update_block_items_per_page
 */
final class BlockItemsPerPageUpdateTest extends UpdatePathTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected function setDatabaseDumpFiles() : void {
    $this->databaseDumpFiles = [
      __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-10.3.0.filled.standard.php.gz',
      __DIR__ . '/../../../fixtures/update/views-block-items-per-page.php',
    ];
  }
  
  /**
   * Tests changing an `items_per_page` setting of `none` to NULL.
   */
  public function testUpdateItemsPerPage() : void {
    $settings = Block::load('olivero_who_s_online')?->get('settings');
    $this->assertIsArray($settings);
    $this->assertSame('none', $settings['items_per_page']);
    $this->runUpdates();
    $settings = Block::load('olivero_who_s_online')?->get('settings');
    $this->assertIsArray($settings);
    $this->assertNull($settings['items_per_page']);
  }

}

Classes

Title Deprecated Summary
BlockItemsPerPageUpdateTest @group Update @covers views_post_update_block_items_per_page[[api-linebreak]]

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