public function FormSubmitterTest::testRedirectWithResponseObject in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php \Drupal\Tests\Core\Form\FormSubmitterTest::testRedirectWithResponseObject()
- 9 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);
}