fixes issue with logging array of non-utf8 data
This commit is contained in:
parent
d270bdc952
commit
eae907c4ed
@ -73,6 +73,37 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
|
||||
));
|
||||
}
|
||||
|
||||
public function testLogNonUtf8Array()
|
||||
{
|
||||
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
|
||||
|
||||
$dbalLogger = $this
|
||||
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
|
||||
->setConstructorArgs(array($logger, null))
|
||||
->setMethods(array('log'))
|
||||
->getMock()
|
||||
;
|
||||
|
||||
$dbalLogger
|
||||
->expects($this->once())
|
||||
->method('log')
|
||||
->with('SQL', array(
|
||||
'utf8' => 'foo',
|
||||
array(
|
||||
'nonutf8' => DbalLogger::BINARY_DATA_VALUE,
|
||||
)
|
||||
)
|
||||
)
|
||||
;
|
||||
|
||||
$dbalLogger->startQuery('SQL', array(
|
||||
'utf8' => 'foo',
|
||||
array(
|
||||
'nonutf8' => "\x7F\xFF",
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
public function testLogLongString()
|
||||
{
|
||||
$logger = $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface');
|
||||
|
Reference in New Issue
Block a user