public function DatabaseTestBase::ensureSampleDataNull in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php \Drupal\KernelTests\Core\Database\DatabaseTestBase::ensureSampleDataNull()
- 9 core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php \Drupal\KernelTests\Core\Database\DatabaseTestBase::ensureSampleDataNull()
Sets up tables for NULL handling.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Database/ DatabaseTestBase.php, line 48
Class
- DatabaseTestBase
- Base class for databases database tests.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function ensureSampleDataNull() {
$this->connection
->insert('test_null')
->fields([
'name',
'age',
])
->values([
'name' => 'Kermit',
'age' => 25,
])
->values([
'name' => 'Fozzie',
'age' => NULL,
])
->values([
'name' => 'Gonzo',
'age' => 27,
])
->execute();
}