diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php index 2701dcb..d9df046 100644 --- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php @@ -98,7 +98,8 @@ public function testForm() { // Test drupalPostForm(). $edit = ['bananas' => 'red']; - $this->drupalPostForm('form-test/object-builder', $edit, 'Save'); + $result = $this->drupalPostForm('form-test/object-builder', $edit, 'Save'); + $this->assertSame($this->getSession()->getPage()->getContent(), $result); $value = $config_factory->get('form_test.object')->get('bananas'); $this->assertSame('red', $value); diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php index bd50c23..91a10cd 100644 --- a/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -920,6 +920,9 @@ protected function submitForm(array $edit, $submit, $form_html_id = NULL) { * POST data. * @param array $options * Options to be forwarded to the url generator. + * + * @return string + * The HTML of the rendered page. */ protected function drupalPostForm($path, $edit, $submit, array $options = []) { if (is_object($submit)) { @@ -938,6 +941,8 @@ protected function drupalPostForm($path, $edit, $submit, array $options = []) { } $this->submitForm($edit, $submit); + + return $this->getSession()->getPage()->getContent(); } /**