Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
7acf85c5
Unverified
Commit
7acf85c5
authored
Apr 03, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reworked implicit array creation
parent
20c5931c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
AbstractPlatform.php
src/Platforms/AbstractPlatform.php
+1
-1
DataAccessTest.php
tests/Functional/DataAccessTest.php
+5
-9
No files found.
src/Platforms/AbstractPlatform.php
View file @
7acf85c5
...
@@ -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
)
{
...
...
tests/Functional/DataAccessTest.php
View file @
7acf85c5
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment