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
d3a3e01d
Unverified
Commit
d3a3e01d
authored
Apr 01, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assert that the value is an array before accessing its elements
parent
754d604d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
DataAccessTest.php
tests/Functional/DataAccessTest.php
+1
-0
MySqlSchemaManagerTest.php
tests/Functional/Schema/MySqlSchemaManagerTest.php
+1
-0
DBAL630Test.php
tests/Functional/Ticket/DBAL630Test.php
+5
-0
No files found.
tests/Functional/DataAccessTest.php
View file @
d3a3e01d
...
...
@@ -343,6 +343,7 @@ class DataAccessTest extends FunctionalTestCase
$sql
=
'SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?'
;
$row
=
$this
->
connection
->
fetchArray
(
$sql
,
[
1
,
'foo'
]);
self
::
assertIsArray
(
$row
);
self
::
assertEquals
(
1
,
$row
[
0
]);
self
::
assertEquals
(
'foo'
,
$row
[
1
]);
}
...
...
tests/Functional/Schema/MySqlSchemaManagerTest.php
View file @
d3a3e01d
...
...
@@ -472,6 +472,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
'SELECT *, DATEDIFF(CURRENT_TIMESTAMP(), col_datetime) as diff_seconds FROM test_column_defaults_are_valid'
);
self
::
assertIsArray
(
$row
);
self
::
assertInstanceOf
(
DateTime
::
class
,
DateTime
::
createFromFormat
(
'Y-m-d H:i:s'
,
$row
[
'col_datetime'
]));
self
::
assertNull
(
$row
[
'col_datetime_null'
]);
self
::
assertSame
(
'2012-12-12'
,
$row
[
'col_date'
]);
...
...
tests/Functional/Ticket/DBAL630Test.php
View file @
d3a3e01d
...
...
@@ -58,6 +58,7 @@ class DBAL630Test extends FunctionalTestCase
$row
=
$this
->
connection
->
fetchAssoc
(
'SELECT bool_col FROM dbal630 WHERE id = ?'
,
[
$id
]);
self
::
assertIsArray
(
$row
);
self
::
assertFalse
(
$row
[
'bool_col'
]);
}
...
...
@@ -73,6 +74,7 @@ class DBAL630Test extends FunctionalTestCase
$row
=
$this
->
connection
->
fetchAssoc
(
'SELECT bool_col FROM dbal630 WHERE id = ?'
,
[
$id
]);
self
::
assertIsArray
(
$row
);
self
::
assertFalse
(
$row
[
'bool_col'
]);
}
...
...
@@ -93,6 +95,7 @@ class DBAL630Test extends FunctionalTestCase
$row
=
$this
->
connection
->
fetchAssoc
(
'SELECT bool_col FROM dbal630 WHERE id = ?'
,
[
$id
]);
self
::
assertIsArray
(
$row
);
self
::
assertFalse
(
$row
[
'bool_col'
]);
}
...
...
@@ -118,6 +121,7 @@ class DBAL630Test extends FunctionalTestCase
$row
=
$this
->
connection
->
fetchAssoc
(
'SELECT bool_col FROM dbal630_allow_nulls WHERE id = ?'
,
[
$id
]);
self
::
assertIsArray
(
$row
);
self
::
assertSame
(
$databaseConvertedValue
,
$row
[
'bool_col'
]);
}
...
...
@@ -147,6 +151,7 @@ class DBAL630Test extends FunctionalTestCase
$row
=
$this
->
connection
->
fetchAssoc
(
'SELECT bool_col FROM dbal630_allow_nulls WHERE id = ?'
,
[
$id
]);
self
::
assertIsArray
(
$row
);
self
::
assertSame
(
$databaseConvertedValue
,
$row
[
'bool_col'
]);
}
...
...
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