Skip to content

Commit

Permalink
fixes issue with logging array of non-utf8 data
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladyslav Petrovych authored and weaverryan committed Jun 27, 2015
1 parent d270bdc commit eae907c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php
Expand Up @@ -73,6 +73,37 @@ public function testLogNonUtf8()
));
}

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');
Expand Down

0 comments on commit eae907c

Please sign in to comment.