LinksPagerWidgetKernelTest.php in Better Exposed Filters 8.5
File
tests/src/Kernel/Plugin/pager/LinksPagerWidgetKernelTest.php
View source
<?php
namespace Drupal\Tests\better_exposed_filters\Kernel\Plugin\pager;
use Drupal\Tests\better_exposed_filters\Kernel\BetterExposedFiltersKernelTestBase;
use Drupal\views\Views;
class LinksPagerWidgetKernelTest extends BetterExposedFiltersKernelTestBase {
public static $testViews = [
'bef_test',
];
public function testExposedLinks() {
$view = Views::getView('bef_test');
$display =& $view->storage
->getDisplay('default');
$display['display_options']['pager']['options']['expose']['items_per_page'] = TRUE;
$display['display_options']['pager']['options']['expose']['offset'] = TRUE;
$this
->setBetterExposedOptions($view, [
'pager' => [
'plugin_id' => 'bef_links',
],
]);
$this
->renderExposedForm($view);
$actual = $this
->xpath('//form//a[starts-with(@name, "items_per_page")]');
$this
->assertCount(4, $actual, 'Exposed pager "items_per_page" has correct number of exposed radio buttons.');
$view
->destroy();
}
}