Reworked implicit array creation

parent 20c5931c
...@@ -1714,7 +1714,7 @@ abstract class AbstractPlatform ...@@ -1714,7 +1714,7 @@ abstract class AbstractPlatform
} }
$query .= ')'; $query .= ')';
$sql[] = $query; $sql = [$query];
if (isset($options['foreignKeys'])) { if (isset($options['foreignKeys'])) {
foreach ((array) $options['foreignKeys'] as $definition) { foreach ((array) $options['foreignKeys'] as $definition) {
......
...@@ -20,13 +20,11 @@ use Doctrine\DBAL\Tests\FunctionalTestCase; ...@@ -20,13 +20,11 @@ use Doctrine\DBAL\Tests\FunctionalTestCase;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use PDO; use PDO;
use const CASE_LOWER; use const CASE_LOWER;
use const PHP_EOL;
use function array_change_key_case; use function array_change_key_case;
use function array_filter; use function array_filter;
use function array_keys; use function array_keys;
use function count; use function count;
use function date; use function date;
use function implode;
use function is_numeric; use function is_numeric;
use function json_encode; use function json_encode;
use function property_exists; use function property_exists;
...@@ -701,14 +699,12 @@ class DataAccessTest extends FunctionalTestCase ...@@ -701,14 +699,12 @@ class DataAccessTest extends FunctionalTestCase
]); ]);
} }
$sql[] = 'SELECT '; $sql = 'SELECT test_int, test_string'
$sql[] = 'test_int, '; . ', ' . $platform->getBitOrComparisonExpression('test_int', 2) . ' AS bit_or'
$sql[] = 'test_string, '; . ', ' . $platform->getBitAndComparisonExpression('test_int', 2) . ' AS bit_and'
$sql[] = $platform->getBitOrComparisonExpression('test_int', 2) . ' AS bit_or, '; . ' FROM fetch_table';
$sql[] = $platform->getBitAndComparisonExpression('test_int', 2) . ' AS bit_and ';
$sql[] = 'FROM fetch_table';
$stmt = $this->connection->executeQuery(implode(PHP_EOL, $sql)); $stmt = $this->connection->executeQuery($sql);
$data = $stmt->fetchAll(FetchMode::ASSOCIATIVE); $data = $stmt->fetchAll(FetchMode::ASSOCIATIVE);
self::assertCount(4, $data); self::assertCount(4, $data);
......
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