1
0
mirror of synced 2025-01-18 22:41:43 +03:00

[2.0] Fixed two annoyances in OrmFunctionalTestCase::onNotSuccesfulTest overwrite.

This commit is contained in:
beberlei 2010-02-06 21:26:56 +00:00
parent fcab40ffe1
commit 0fa136e369

View File

@ -214,13 +214,13 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
protected function onNotSuccessfulTest(\Exception $e)
{
if ($e instanceof \PHPUnit_Framework_ExpectationFailedException) {
if ($e instanceof \PHPUnit_Framework_AssertionFailedError) {
throw $e;
}
if(isset($this->_sqlLoggerStack->queries) && count($this->_sqlLoggerStack->queries)) {
$queries = "";
for($i = 0; $i < count($this->_sqlLoggerStack->queries); $i++) {
for($i = count($this->_sqlLoggerStack->queries)-1; $i > max(count($this->_sqlLoggerStack->queries)-25, 0); $i--) {
$query = $this->_sqlLoggerStack->queries[$i];
$params = array_map(function($p) { return "'".$p."'"; }, $query['params'] ?: array());
$queries .= ($i+1).". SQL: '".$query['sql']."' Params: ".implode(", ", $params).PHP_EOL;