fixes issue with logging array of non-utf8 data

This commit is contained in:
Vladyslav Petrovych 2013-09-21 14:40:33 +03:00 committed by Ryan Weaver
parent d270bdc952
commit eae907c4ed

View File

@ -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');