function NodeCreationTest::testNodeCreateExceptionHandling
Same name and namespace in other branches
- 11.x core/modules/node/tests/src/Functional/NodeCreationTest.php \Drupal\Tests\node\Functional\NodeCreationTest::testNodeCreateExceptionHandling()
Tests exception handling when saving a node through the form.
File
-
core/
modules/ node/ tests/ src/ Functional/ NodeCreationTest.php, line 318
Class
- NodeCreationTest
- Create a node and test saving it.
Namespace
Drupal\Tests\node\FunctionalCode
public function testNodeCreateExceptionHandling() : void {
$this->drupalGet('node/add/page');
$this->submitForm([
'title[0][value]' => 'testing_transaction_exception',
'body[0][value]' => $this->randomMachineName(16),
], 'Save');
$this->assertSession()
->pageTextNotContains('The website encountered an unexpected error.');
$this->assertSession()
->pageTextContains('The content could not be saved. Contact the site administrator if the problem persists.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.