public function AmountFormattingFormTest::testSubmitForm in Currency 8.3
Same name in this branch
- 8.3 tests/src/Unit/Controller/AmountFormattingFormTest.php \Drupal\Tests\currency\Unit\Controller\AmountFormattingFormTest::testSubmitForm()
- 8.3 tests/src/Unit/Form/AmountFormattingFormTest.php \Drupal\Tests\currency\Unit\Form\AmountFormattingFormTest::testSubmitForm()
@covers ::submitForm
File
- tests/
src/ Unit/ Controller/ AmountFormattingFormTest.php, line 184
Class
- AmountFormattingFormTest
- @coversDefaultClass \Drupal\currency\Form\AmountFormattingForm
Namespace
Drupal\Tests\currency\Unit\ControllerCode
public function testSubmitForm() {
$plugin_id = $this
->randomMachineName();
$values = [
'default_plugin_id' => $plugin_id,
];
$form = [];
$form_state = new FormState();
$form_state
->setValues($values);
$config = $this
->getMockBuilder(Config::class)
->disableOriginalConstructor()
->getMock();
$config
->expects($this
->atLeastOnce())
->method('set')
->with('plugin_id', $plugin_id);
$config
->expects($this
->atLeastOnce())
->method('save');
$this->configFactory
->expects($this
->atLeastOnce())
->method('getEditable')
->with('currency.amount_formatting')
->willReturn($config);
$this->controller
->submitForm($form, $form_state);
}