[DoctrineMongoDBBundle] fixed logging of null values
This commit is contained in:
parent
3dfbc08d73
commit
e4d3045925
@ -248,7 +248,9 @@ class DoctrineMongoDBLogger
|
||||
$array = false;
|
||||
}
|
||||
|
||||
if (is_bool($value)) {
|
||||
if (null === $value) {
|
||||
$formatted = 'null';
|
||||
} elseif (is_bool($value)) {
|
||||
$formatted = $value ? 'true' : 'false';
|
||||
} elseif (is_numeric($value)) {
|
||||
$formatted = $value;
|
||||
|
@ -42,8 +42,8 @@ class DoctrineMongoDBLoggerTest extends \PHPUnit_Framework_TestCase
|
||||
),
|
||||
// find
|
||||
array(
|
||||
array('db' => 'foo', 'collection' => 'bar', 'find' => true, 'query' => array(), 'fields' => array()),
|
||||
array('use foo;', 'db.bar.find();'),
|
||||
array('db' => 'foo', 'collection' => 'bar', 'find' => true, 'query' => array('foo' => null), 'fields' => array()),
|
||||
array('use foo;', 'db.bar.find({ "foo": null });'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user