Skip to content

Commit

Permalink
Fix tests to run when database name is not cakephp_test
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 9, 2018
1 parent 2bea29d commit 4aa0df8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php
Expand Up @@ -1455,6 +1455,8 @@ public function testNoExtraRowsForAssociatedTranslations() {

public function testBeforeFindAllI18nConditions() {
$this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.');
$dbName = $this->db->config['database'];

$this->loadFixtures('TranslateArticle', 'TranslatedArticle', 'User');
$TestModel = new TranslatedArticle();
$TestModel->cacheQueries = false;
Expand All @@ -1471,7 +1473,7 @@ public function testBeforeFindAllI18nConditions() {
'table' => (object)array(
'tablePrefix' => '',
'table' => 'article_i18n',
'schemaName' => 'cakephp_test',
'schemaName' => $dbName,
),
'conditions' => array(
'TranslatedArticle.id' => (object)array(
Expand All @@ -1489,7 +1491,7 @@ public function testBeforeFindAllI18nConditions() {
'table' => (object)array(
'tablePrefix' => '',
'table' => 'article_i18n',
'schemaName' => 'cakephp_test',
'schemaName' => $dbName,
),
'conditions' => array(
'TranslatedArticle.id' => (object)array(
Expand Down Expand Up @@ -1537,6 +1539,8 @@ public function testBeforeFindAllI18nConditions() {

public function testBeforeFindCountI18nConditions() {
$this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.');
$dbName = $this->db->config['database'];

$this->loadFixtures('TranslateArticle', 'TranslatedArticle', 'User');
$TestModel = new TranslatedArticle();
$TestModel->cacheQueries = false;
Expand All @@ -1553,7 +1557,7 @@ public function testBeforeFindCountI18nConditions() {
'table' => (object)array(
'tablePrefix' => '',
'table' => 'article_i18n',
'schemaName' => 'cakephp_test',
'schemaName' => $dbName,
),
'conditions' => array(
'`TranslatedArticle`.`id`' => (object)array(
Expand All @@ -1570,7 +1574,7 @@ public function testBeforeFindCountI18nConditions() {
'table' => (object)array(
'tablePrefix' => '',
'table' => 'article_i18n',
'schemaName' => 'cakephp_test',
'schemaName' => $dbName,
),
'conditions' => array(
'TranslatedArticle.id' => (object)array(
Expand Down
12 changes: 8 additions & 4 deletions lib/Cake/Test/Case/Model/ModelReadTest.php
Expand Up @@ -6486,6 +6486,8 @@ public function testBuildQuery() {

public function testBuildQueryAllI18nConditions() {
$this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.');
$dbName = $this->db->config['database'];

$this->loadFixtures('TranslateArticle', 'TranslatedArticle', 'User');
$TestModel = new TranslatedArticle();
$TestModel->cacheQueries = false;
Expand All @@ -6502,7 +6504,7 @@ public function testBuildQueryAllI18nConditions() {
'table' => (object)array(
'tablePrefix' => '',
'table' => 'article_i18n',
'schemaName' => 'cakephp_test',
'schemaName' => $dbName
),
'conditions' => array(
'TranslatedArticle.id' => (object)array(
Expand All @@ -6520,7 +6522,7 @@ public function testBuildQueryAllI18nConditions() {
'table' => (object)array(
'tablePrefix' => '',
'table' => 'article_i18n',
'schemaName' => 'cakephp_test',
'schemaName' => $dbName
),
'conditions' => array(
'TranslatedArticle.id' => (object)array(
Expand Down Expand Up @@ -6556,6 +6558,8 @@ public function testBuildQueryAllI18nConditions() {

public function testBuildQueryCountI18nConditions() {
$this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.');
$dbName = $this->db->config['database'];
j
$this->loadFixtures('TranslateArticle', 'TranslatedArticle', 'User');
$TestModel = new TranslatedArticle();
$TestModel->cacheQueries = false;
Expand All @@ -6572,7 +6576,7 @@ public function testBuildQueryCountI18nConditions() {
'table' => (object)array(
'tablePrefix' => '',
'table' => 'article_i18n',
'schemaName' => 'cakephp_test',
'schemaName' => $dbName
),
'conditions' => array(
'`TranslatedArticle`.`id`' => (object)array(
Expand All @@ -6589,7 +6593,7 @@ public function testBuildQueryCountI18nConditions() {
'table' => (object)array(
'tablePrefix' => '',
'table' => 'article_i18n',
'schemaName' => 'cakephp_test',
'schemaName' => $dbName
),
'conditions' => array(
'TranslatedArticle.id' => (object)array(
Expand Down

0 comments on commit 4aa0df8

Please sign in to comment.