From bb67df4305c87850120ff122476d77591ed92b42 Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 31 Oct 2014 01:18:08 +0100 Subject: [PATCH] Simplify test --- lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 710e9da80..2bd188aad 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -3442,14 +3442,17 @@ SQL; ); $conditions = array('Article.id' => array(1, 2)); $contain = array('Comment.extra'); + + $test = ConnectionManager::getDatasource('test'); + $test->getLog(); $result = $Article->find('all', compact('conditions', 'contain')); $expected = 'SELECT `Comment`.`id`, `Comment`.`article_id`, `Comment`.`user_id`, `Comment`.`comment`, `Comment`.`published`, `Comment`.`created`,' . ' `Comment`.`updated`, (SELECT id FROM comments WHERE id = (SELECT 1)) AS `Comment__extra`' . ' FROM `cake_test`.`comments` AS `Comment` WHERE `Comment`.`article_id` IN (1, 2)'; - $test = ConnectionManager::getDatasource('test'); + $log = $test->getLog(); - $this->assertTextEquals($expected, $log['log'][116]['query']); + $this->assertTextEquals($expected, $log['log'][count($log['log']) - 2]['query']); } /**