function UpdateTest::testUpdateNonExistingTable
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/UpdateTest.php \Drupal\KernelTests\Core\Database\UpdateTest::testUpdateNonExistingTable()
- 11.x core/tests/Drupal/KernelTests/Core/Database/UpdateTest.php \Drupal\KernelTests\Core\Database\UpdateTest::testUpdateNonExistingTable()
Updating a not existing table throws a DatabaseExceptionWrapper.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ UpdateTest.php, line 154
Class
- UpdateTest
- Tests the update query builder.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testUpdateNonExistingTable() : void {
$this->expectException(DatabaseExceptionWrapper::class);
$this->connection
->update('a-table-that-does-not-exist')
->fields([
'update' => 'New update value',
])
->condition('id', 1)
->execute();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.