RadioButtonsPagerWidgetKernelTest.php in Better Exposed Filters 8.5
File
tests/src/Kernel/Plugin/pager/RadioButtonsPagerWidgetKernelTest.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 RadioButtonsPagerWidgetKernelTest extends BetterExposedFiltersKernelTestBase {
public static $testViews = [
'bef_test',
];
public function testExposedRadioButtons() {
$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',
],
]);
$this
->renderExposedForm($view);
$actual = $this
->xpath('//form//input[@type="radio" and starts-with(@name, "items_per_page")]');
$this
->assertCount(4, $actual, 'Exposed pager "items_per_page" has correct number of exposed radio buttons.');
$view
->destroy();
}
}