From d72c2d7e0e2900736d87683ba576187c31e612dc Mon Sep 17 00:00:00 2001 From: Val Bancer Date: Sun, 9 Jul 2017 20:05:53 +0200 Subject: [PATCH] fixed code style, skipped pgsql and sqlite incompartible tests --- lib/Cake/Model/Behavior/TranslateBehavior.php | 14 +++++++------- .../Case/Model/Behavior/TranslateBehaviorTest.php | 4 +++- lib/Cake/Test/Case/Model/ModelReadTest.php | 6 ++++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/Cake/Model/Behavior/TranslateBehavior.php b/lib/Cake/Model/Behavior/TranslateBehavior.php index 8223b7e87..740fcccad 100644 --- a/lib/Cake/Model/Behavior/TranslateBehavior.php +++ b/lib/Cake/Model/Behavior/TranslateBehavior.php @@ -251,13 +251,13 @@ class TranslateBehavior extends ModelBehavior { return $this->_getConditionFields($Model, $query['conditions']); } - /** - * Extracts condition field names recursively. - * - * @param Model $Model The model being read. - * @param array $conditions The conditions array. - * @return array The list of condition fields. - */ +/** + * Extracts condition field names recursively. + * + * @param Model $Model The model being read. + * @param array $conditions The conditions array. + * @return array The list of condition fields. + */ protected function _getConditionFields(Model $Model, $conditions) { $conditionFields = array(); foreach ($conditions as $col => $val) { diff --git a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php index 5f74583c2..251e8a8bb 100644 --- a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php @@ -1444,6 +1444,7 @@ class TranslateBehaviorTest extends CakeTestCase { } public function testBeforeFindAllI18nConditions() { + $this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.'); $this->loadFixtures('TranslateArticle', 'TranslatedArticle', 'User'); $TestModel = new TranslatedArticle(); $TestModel->cacheQueries = false; @@ -1525,6 +1526,7 @@ class TranslateBehaviorTest extends CakeTestCase { } public function testBeforeFindCountI18nConditions() { + $this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.'); $this->loadFixtures('TranslateArticle', 'TranslatedArticle', 'User'); $TestModel = new TranslatedArticle(); $TestModel->cacheQueries = false; @@ -1581,7 +1583,7 @@ class TranslateBehaviorTest extends CakeTestCase { 'callbacks' => true, 'recursive' => 0, ); - $query= array( + $query = array( 'conditions' => array( 'NOT' => array( 'I18n__title.content' => '', diff --git a/lib/Cake/Test/Case/Model/ModelReadTest.php b/lib/Cake/Test/Case/Model/ModelReadTest.php index 3b6a54b5f..e993fc9d4 100644 --- a/lib/Cake/Test/Case/Model/ModelReadTest.php +++ b/lib/Cake/Test/Case/Model/ModelReadTest.php @@ -6426,6 +6426,7 @@ class ModelReadTest extends BaseModelTest { } public function testBuildQueryAllI18nConditions() { + $this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.'); $this->loadFixtures('TranslateArticle', 'TranslatedArticle', 'User'); $TestModel = new TranslatedArticle(); $TestModel->cacheQueries = false; @@ -6483,7 +6484,7 @@ class ModelReadTest extends BaseModelTest { 'callbacks' => true, 'recursive' => 0, ); - $query= array( + $query = array( 'recursive' => 0, 'conditions' => array( 'NOT' => array('I18n__title.content' => ''), @@ -6495,6 +6496,7 @@ class ModelReadTest extends BaseModelTest { } public function testBuildQueryCountI18nConditions() { + $this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.'); $this->loadFixtures('TranslateArticle', 'TranslatedArticle', 'User'); $TestModel = new TranslatedArticle(); $TestModel->cacheQueries = false; @@ -6551,7 +6553,7 @@ class ModelReadTest extends BaseModelTest { 'callbacks' => true, 'recursive' => 0, ); - $query= array( + $query = array( 'recursive' => 0, 'conditions' => array( 'NOT' => array('I18n__title.content' => ''),