diff --git a/core/modules/system/src/Tests/Database/ConnectionTest.php b/core/modules/system/src/Tests/Database/ConnectionTest.php index c0d9253..f174ec9 100644 --- a/core/modules/system/src/Tests/Database/ConnectionTest.php +++ b/core/modules/system/src/Tests/Database/ConnectionTest.php @@ -118,4 +118,22 @@ function testConnectionOptions() { $this->assertNotEqual($connection_info['default']['database'], $connectionOptions['database'], 'The test connection info database does not match the current connection options database.'); } + /** + * Ensure that you cannot execute multiple queries on phpversion() > 5.5.21. + */ + public function testMultipleQueriesForNewPhp() { + if (!defined('\PDO::MYSQL_ATTR_MULTI_STATEMENTS')) { + return; + } + + $db = Database::getConnection('default', 'default'); + try { + $db->query('SELECT * FROM {test}; SELECT * FROM {test_people}')->execute(); + $this->fail('NO PDO exception thrown for multiple queries.'); + } + catch (\Exception $e) { + $this->pass('PDO exception thrown for multiple queries.'); + } + } + }