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
9b3ace24
Commit
9b3ace24
authored
Jan 03, 2015
by
Steve Müller
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #720 from TerjeBr/json_type-update
Type json_array is not consistent with NULL values
parents
e3441215
4d99ed40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
JsonArrayType.php
lib/Doctrine/DBAL/Types/JsonArrayType.php
+1
-1
JsonArrayTest.php
tests/Doctrine/Tests/DBAL/Types/JsonArrayTest.php
+5
-0
No files found.
lib/Doctrine/DBAL/Types/JsonArrayType.php
View file @
9b3ace24
...
...
@@ -54,7 +54,7 @@ class JsonArrayType extends Type
*/
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
{
if
(
$value
===
null
)
{
if
(
$value
===
null
||
$value
===
''
)
{
return
array
();
}
...
...
tests/Doctrine/Tests/DBAL/Types/JsonArrayTest.php
View file @
9b3ace24
...
...
@@ -48,6 +48,11 @@ class JsonArrayTest extends \Doctrine\Tests\DbalTestCase
$this
->
assertSame
(
array
(),
$this
->
type
->
convertToPHPValue
(
null
,
$this
->
platform
));
}
public
function
testJsonEmptyStringConvertsToPHPValue
()
{
$this
->
assertSame
(
array
(),
$this
->
type
->
convertToPHPValue
(
''
,
$this
->
platform
));
}
public
function
testJsonStringConvertsToPHPValue
()
{
$value
=
array
(
'foo'
=>
'bar'
,
'bar'
=>
'foo'
);
...
...
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