fixed code style, skipped pgsql and sqlite incompartible tests

This commit is contained in:
Val Bancer 2017-07-09 20:05:53 +02:00
parent 794ce22f37
commit d72c2d7e0e
3 changed files with 14 additions and 10 deletions

View file

@ -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) {

View file

@ -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' => '',

View file

@ -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' => ''),