function FormSubmitterTest::testRedirectWithResponseObject
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php \Drupal\Tests\Core\Form\FormSubmitterTest::testRedirectWithResponseObject()
- 10 core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php \Drupal\Tests\Core\Form\FormSubmitterTest::testRedirectWithResponseObject()
- 11.x core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php \Drupal\Tests\Core\Form\FormSubmitterTest::testRedirectWithResponseObject()
Tests the redirectForm() method with a response object.
@covers ::redirectForm
File
-
core/
tests/ Drupal/ Tests/ Core/ Form/ FormSubmitterTest.php, line 181
Class
- FormSubmitterTest
- @coversDefaultClass \Drupal\Core\Form\FormSubmitter @group Form
Namespace
Drupal\Tests\Core\FormCode
public function testRedirectWithResponseObject() {
$form_submitter = $this->getFormSubmitter();
$redirect = new RedirectResponse('/example');
$form_state = $this->createMock('Drupal\\Core\\Form\\FormStateInterface');
$form_state->expects($this->once())
->method('getRedirect')
->willReturn($redirect);
$result_redirect = $form_submitter->redirectForm($form_state);
$this->assertSame($redirect, $result_redirect);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.