You are here

public function ConnectionTest::testMultipleStatements in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php \Drupal\KernelTests\Core\Database\ConnectionTest::testMultipleStatements()

Ensure that you cannot execute multiple statements.

File

core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php, line 139

Class

ConnectionTest
Tests of the core database system.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testMultipleStatements() {
  $this
    ->expectException(\InvalidArgumentException::class);
  Database::getConnection('default', 'default')
    ->query('SELECT * FROM {test}; SELECT * FROM {test_people}');
}