Replace $conn->query() with $conn->executeQuery() and $conn->executeStatement()

parent 2d6967f0
...@@ -12,5 +12,5 @@ use Doctrine\DBAL\DriverManager; ...@@ -12,5 +12,5 @@ use Doctrine\DBAL\DriverManager;
'user' => 'ORACLE', 'user' => 'ORACLE',
'password' => 'ORACLE', 'password' => 'ORACLE',
'dbname' => 'XE', 'dbname' => 'XE',
])->query('ALTER USER ORACLE IDENTIFIED BY ORACLE'); ])->executeStatement('ALTER USER ORACLE IDENTIFIED BY ORACLE');
})(); })();
...@@ -30,7 +30,7 @@ class ConnectionLostTest extends FunctionalTestCase ...@@ -30,7 +30,7 @@ class ConnectionLostTest extends FunctionalTestCase
public function testConnectionLost(): void public function testConnectionLost(): void
{ {
$this->connection->query('SET SESSION wait_timeout=1'); $this->connection->executeStatement('SET SESSION wait_timeout=1');
sleep(2); sleep(2);
......
...@@ -53,7 +53,7 @@ class PortabilityTest extends FunctionalTestCase ...@@ -53,7 +53,7 @@ class PortabilityTest extends FunctionalTestCase
$rows = $this->connection->fetchAllAssociative('SELECT * FROM portability_table'); $rows = $this->connection->fetchAllAssociative('SELECT * FROM portability_table');
$this->assertFetchResultRows($rows); $this->assertFetchResultRows($rows);
$result = $this->connection->query('SELECT * FROM portability_table'); $result = $this->connection->executeQuery('SELECT * FROM portability_table');
while (($row = $result->fetchAssociative())) { while (($row = $result->fetchAssociative())) {
$this->assertFetchResultRow($row); $this->assertFetchResultRow($row);
...@@ -73,7 +73,7 @@ class PortabilityTest extends FunctionalTestCase ...@@ -73,7 +73,7 @@ class PortabilityTest extends FunctionalTestCase
$rows = $this->connection->fetchAllAssociative('SELECT * FROM portability_table'); $rows = $this->connection->fetchAllAssociative('SELECT * FROM portability_table');
$this->assertFetchResultRows($rows); $this->assertFetchResultRows($rows);
$result = $this->connection->query('SELECT * FROM portability_table'); $result = $this->connection->executeQuery('SELECT * FROM portability_table');
while (($row = $result->fetchAssociative())) { while (($row = $result->fetchAssociative())) {
$this->assertFetchResultRow($row); $this->assertFetchResultRow($row);
} }
...@@ -120,7 +120,7 @@ class PortabilityTest extends FunctionalTestCase ...@@ -120,7 +120,7 @@ class PortabilityTest extends FunctionalTestCase
*/ */
public function testFetchColumn(string $field, array $expected): void public function testFetchColumn(string $field, array $expected): void
{ {
$result = $this->connection->query('SELECT ' . $field . ' FROM portability_table'); $result = $this->connection->executeQuery('SELECT ' . $field . ' FROM portability_table');
$column = $result->fetchFirstColumn(); $column = $result->fetchFirstColumn();
self::assertEquals($expected, $column); self::assertEquals($expected, $column);
......
...@@ -520,7 +520,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -520,7 +520,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public function testEnsureTableOptionsAreReflectedInMetadata(): void public function testEnsureTableOptionsAreReflectedInMetadata(): void
{ {
$this->connection->query('DROP TABLE IF EXISTS test_table_metadata'); $this->connection->executeStatement('DROP TABLE IF EXISTS test_table_metadata');
$sql = <<<'SQL' $sql = <<<'SQL'
CREATE TABLE test_table_metadata( CREATE TABLE test_table_metadata(
...@@ -534,7 +534,7 @@ AUTO_INCREMENT=42 ...@@ -534,7 +534,7 @@ AUTO_INCREMENT=42
PARTITION BY HASH (col1) PARTITION BY HASH (col1)
SQL; SQL;
$this->connection->query($sql); $this->connection->executeStatement($sql);
$onlineTable = $this->schemaManager->listTableDetails('test_table_metadata'); $onlineTable = $this->schemaManager->listTableDetails('test_table_metadata');
self::assertEquals('InnoDB', $onlineTable->getOption('engine')); self::assertEquals('InnoDB', $onlineTable->getOption('engine'));
...@@ -549,9 +549,9 @@ SQL; ...@@ -549,9 +549,9 @@ SQL;
public function testEnsureTableWithoutOptionsAreReflectedInMetadata(): void public function testEnsureTableWithoutOptionsAreReflectedInMetadata(): void
{ {
$this->connection->query('DROP TABLE IF EXISTS test_table_empty_metadata'); $this->connection->executeStatement('DROP TABLE IF EXISTS test_table_empty_metadata');
$this->connection->query('CREATE TABLE test_table_empty_metadata(col1 INT NOT NULL)'); $this->connection->executeStatement('CREATE TABLE test_table_empty_metadata(col1 INT NOT NULL)');
$onlineTable = $this->schemaManager->listTableDetails('test_table_empty_metadata'); $onlineTable = $this->schemaManager->listTableDetails('test_table_empty_metadata');
self::assertNotEmpty($onlineTable->getOption('engine')); self::assertNotEmpty($onlineTable->getOption('engine'));
......
...@@ -1444,7 +1444,7 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase ...@@ -1444,7 +1444,7 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase
"SELECT id FROM test_pk_auto_increment WHERE text = '1'" "SELECT id FROM test_pk_auto_increment WHERE text = '1'"
); );
$this->connection->query('DELETE FROM test_pk_auto_increment'); $this->connection->executeStatement('DELETE FROM test_pk_auto_increment');
$this->connection->insert('test_pk_auto_increment', ['text' => '2']); $this->connection->insert('test_pk_auto_increment', ['text' => '2']);
......
...@@ -234,7 +234,7 @@ SQL; ...@@ -234,7 +234,7 @@ SQL;
$this->connection->insert('test_pk_auto_increment', ['text' => '1']); $this->connection->insert('test_pk_auto_increment', ['text' => '1']);
$this->connection->query('DELETE FROM test_pk_auto_increment'); $this->connection->executeStatement('DELETE FROM test_pk_auto_increment');
$this->connection->insert('test_pk_auto_increment', ['text' => '2']); $this->connection->insert('test_pk_auto_increment', ['text' => '2']);
......
...@@ -29,7 +29,7 @@ class TransactionTest extends FunctionalTestCase ...@@ -29,7 +29,7 @@ class TransactionTest extends FunctionalTestCase
public function testCommitFalse(): void public function testCommitFalse(): void
{ {
$this->connection->query('SET SESSION wait_timeout=1'); $this->connection->executeStatement('SET SESSION wait_timeout=1');
self::assertTrue($this->connection->beginTransaction()); self::assertTrue($this->connection->beginTransaction());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment