protected function ViewsModerationStateFilterTest::assertPluginStates in Drupal 9
Same name and namespace in other branches
- 8 core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php \Drupal\Tests\content_moderation\Kernel\ViewsModerationStateFilterTest::assertPluginStates()
Assert the plugin states.
Parameters
string[] $states: The states which should appear in the filter.
1 call to ViewsModerationStateFilterTest::assertPluginStates()
- ViewsModerationStateFilterTest::testStateFilterStatesList in core/
modules/ content_moderation/ tests/ src/ Kernel/ ViewsModerationStateFilterTest.php - Tests the list of states in the filter plugin.
File
- core/
modules/ content_moderation/ tests/ src/ Kernel/ ViewsModerationStateFilterTest.php, line 325
Class
- ViewsModerationStateFilterTest
- Tests the views 'moderation_state_filter' filter plugin.
Namespace
Drupal\Tests\content_moderation\KernelCode
protected function assertPluginStates($states) {
$plugin = Views::pluginManager('filter')
->createInstance('moderation_state_filter', []);
$view = Views::getView('test_content_moderation_state_filter_base_table');
$plugin
->init($view, $view
->getDisplay());
$this
->assertEquals($states, $plugin
->getValueOptions());
}