Skip to content

Commit 6d5fb94

Browse files
Vladyslav Petrovychweaverryan
authored andcommitted
fixes issue with logging array of non-utf8 data
1 parent 7d9bd23 commit 6d5fb94

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Tests/Logger/DbalLoggerTest.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,37 @@ public function testLogNonUtf8()
7373
));
7474
}
7575

76+
public function testLogNonUtf8Array()
77+
{
78+
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
79+
80+
$dbalLogger = $this
81+
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
82+
->setConstructorArgs(array($logger, null))
83+
->setMethods(array('log'))
84+
->getMock()
85+
;
86+
87+
$dbalLogger
88+
->expects($this->once())
89+
->method('log')
90+
->with('SQL', array(
91+
'utf8' => 'foo',
92+
array(
93+
'nonutf8' => DbalLogger::BINARY_DATA_VALUE,
94+
)
95+
)
96+
)
97+
;
98+
99+
$dbalLogger->startQuery('SQL', array(
100+
'utf8' => 'foo',
101+
array(
102+
'nonutf8' => "\x7F\xFF",
103+
)
104+
));
105+
}
106+
76107
public function testLogLongString()
77108
{
78109
$logger = $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface');

0 commit comments

Comments
 (0)