Loading core/tests/Drupal/FunctionalTests/Installer/InstallerDatabaseErrorMessagesTest.php +11 −1 Changes for core/tests/Drupal/FunctionalTests/Installer/InstallerDatabaseErrorMessagesTest.php: 11 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -24,7 +24,17 @@ protected function setUpSettings() { // it will try and create the drupal_install_test table as this is part of // the standard database tests performed by the installer in // Drupal\Core\Database\Install\Tasks. Database::getConnection('default')->query('CREATE TABLE {drupal_install_test} (id int NOT NULL PRIMARY KEY)'); $spec = [ 'fields' => [ 'id' => [ 'type' => 'int', 'not null' => TRUE, ], ], 'primary key' => ['id'], ]; Database::getConnection('default')->schema()->createTable('drupal_install_test', $spec); parent::setUpSettings(); } Loading core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php +12 −2 Changes for core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php: 12 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -53,7 +53,17 @@ protected function setUpSettings() { // it will try and create the drupal_install_test table as this is part of // the standard database tests performed by the installer in // Drupal\Core\Database\Install\Tasks. Database::getConnection('default')->query('CREATE TABLE {drupal_install_test} (id int NOT NULL PRIMARY KEY)'); $spec = [ 'fields' => [ 'id' => [ 'type' => 'int', 'not null' => TRUE, ], ], 'primary key' => ['id'], ]; Database::getConnection('default')->schema()->createTable('drupal_install_test', $spec); parent::setUpSettings(); // Ensure that the error message translation is working. Loading @@ -63,7 +73,7 @@ protected function setUpSettings() { // cSpell:enable // Now do it successfully. Database::getConnection('default')->query('DROP TABLE {drupal_install_test}'); Database::getConnection('default')->schema()->dropTable('drupal_install_test'); parent::setUpSettings(); } Loading core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php +4 −1 Changes for core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -41,7 +41,10 @@ public function testDatabaseLoaded() { // Ensure that all {router} entries can be unserialized. If they cannot be // unserialized a notice will be thrown by PHP. $result = \Drupal::database()->query("SELECT name, route from {router}")->fetchAllKeyed(0, 1); $result = \Drupal::database()->select('router', 'r') ->fields('r', ['name', 'route']) ->execute() ->fetchAllKeyed(0, 1); // For the purpose of fetching the notices and displaying more helpful error // messages, let's override the error handler temporarily. set_error_handler(function ($severity, $message, $filename, $lineno) { Loading core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php +1 −1 Changes for core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -213,7 +213,7 @@ public function testScriptLoad() { } // Ensure the test config has been replaced. $config = unserialize($connection->query("SELECT data FROM {config} WHERE name = 'test_config'")->fetchField()); $config = unserialize($connection->select('config', 'c')->fields('c', ['data'])->condition('name', 'test_config')->execute()->fetchField()); $this->assertIdentical($config, $this->data, 'Script has properly restored the config table data.'); // Ensure the cache data was not exported. Loading core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php +1 −1 Changes for core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ protected function setUp(): void { } protected function read($name) { $data = Database::getConnection()->query('SELECT data FROM {config} WHERE name = :name', [':name' => $name])->fetchField(); $data = Database::getConnection()->select('config', 'c')->fields('c', ['data'])->condition('name', $name)->execute()->fetchField(); return unserialize($data); } Loading Loading
core/tests/Drupal/FunctionalTests/Installer/InstallerDatabaseErrorMessagesTest.php +11 −1 Changes for core/tests/Drupal/FunctionalTests/Installer/InstallerDatabaseErrorMessagesTest.php: 11 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -24,7 +24,17 @@ protected function setUpSettings() { // it will try and create the drupal_install_test table as this is part of // the standard database tests performed by the installer in // Drupal\Core\Database\Install\Tasks. Database::getConnection('default')->query('CREATE TABLE {drupal_install_test} (id int NOT NULL PRIMARY KEY)'); $spec = [ 'fields' => [ 'id' => [ 'type' => 'int', 'not null' => TRUE, ], ], 'primary key' => ['id'], ]; Database::getConnection('default')->schema()->createTable('drupal_install_test', $spec); parent::setUpSettings(); } Loading
core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php +12 −2 Changes for core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php: 12 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -53,7 +53,17 @@ protected function setUpSettings() { // it will try and create the drupal_install_test table as this is part of // the standard database tests performed by the installer in // Drupal\Core\Database\Install\Tasks. Database::getConnection('default')->query('CREATE TABLE {drupal_install_test} (id int NOT NULL PRIMARY KEY)'); $spec = [ 'fields' => [ 'id' => [ 'type' => 'int', 'not null' => TRUE, ], ], 'primary key' => ['id'], ]; Database::getConnection('default')->schema()->createTable('drupal_install_test', $spec); parent::setUpSettings(); // Ensure that the error message translation is working. Loading @@ -63,7 +73,7 @@ protected function setUpSettings() { // cSpell:enable // Now do it successfully. Database::getConnection('default')->query('DROP TABLE {drupal_install_test}'); Database::getConnection('default')->schema()->dropTable('drupal_install_test'); parent::setUpSettings(); } Loading
core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php +4 −1 Changes for core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -41,7 +41,10 @@ public function testDatabaseLoaded() { // Ensure that all {router} entries can be unserialized. If they cannot be // unserialized a notice will be thrown by PHP. $result = \Drupal::database()->query("SELECT name, route from {router}")->fetchAllKeyed(0, 1); $result = \Drupal::database()->select('router', 'r') ->fields('r', ['name', 'route']) ->execute() ->fetchAllKeyed(0, 1); // For the purpose of fetching the notices and displaying more helpful error // messages, let's override the error handler temporarily. set_error_handler(function ($severity, $message, $filename, $lineno) { Loading
core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php +1 −1 Changes for core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -213,7 +213,7 @@ public function testScriptLoad() { } // Ensure the test config has been replaced. $config = unserialize($connection->query("SELECT data FROM {config} WHERE name = 'test_config'")->fetchField()); $config = unserialize($connection->select('config', 'c')->fields('c', ['data'])->condition('name', 'test_config')->execute()->fetchField()); $this->assertIdentical($config, $this->data, 'Script has properly restored the config table data.'); // Ensure the cache data was not exported. Loading
core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php +1 −1 Changes for core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ protected function setUp(): void { } protected function read($name) { $data = Database::getConnection()->query('SELECT data FROM {config} WHERE name = :name', [':name' => $name])->fetchField(); $data = Database::getConnection()->select('config', 'c')->fields('c', ['data'])->condition('name', $name)->execute()->fetchField(); return unserialize($data); } Loading