function WizardPluginBaseTest::testGetSelected
@covers ::getSelected
      
    
@dataProvider providerTestGetSelected
File
- 
              core/
modules/ views/ tests/ src/ Unit/ WizardPluginBaseTest.php, line 21  
Class
- WizardPluginBaseTest
 - @coversDefaultClass \Drupal\views\Plugin\views\wizard\WizardPluginBase[[api-linebreak]]
 
Namespace
Drupal\Tests\views\UnitCode
public function testGetSelected($expected, $element = [], $parents = [], $user_input = [], $not_rebuilding_expected = NULL) {
  $not_rebuilding_expected = $not_rebuilding_expected ?: $expected;
  $form_state = new FormState();
  $form_state->setUserInput($user_input);
  $actual = WizardPluginBase::getSelected($form_state, $parents, 'the_default_value', $element);
  $this->assertSame($not_rebuilding_expected, $actual);
  $this->assertSame($user_input, $form_state->getUserInput());
  $form_state->setRebuild();
  $actual = WizardPluginBase::getSelected($form_state, $parents, 'the_default_value', $element);
  $this->assertSame($expected, $actual);
  $this->assertSame($user_input, $form_state->getUserInput());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.