diff --git a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php index 872779c2f8..eacbd4f3c9 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php @@ -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');