Skip to content

Commit

Permalink
Finish fixing connection aliasing.
Browse files Browse the repository at this point in the history
The code in #8414 removed the defaultConnectionName from a test model.
This shouldn't have been removed as it was exposing an issue in #8414.

Refs #8414
  • Loading branch information
markstory committed Mar 6, 2016
1 parent 1151547 commit 9514316
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/TestSuite/Fixture/FixtureManager.php
Expand Up @@ -139,7 +139,7 @@ protected function _aliasConnections()
}
}
foreach ($map as $alias => $connection) {
ConnectionManager::alias($connection, $alias);
ConnectionManager::alias($alias, $connection);
}
}

Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/ORM/Behavior/TranslateBehaviorTest.php
Expand Up @@ -93,6 +93,7 @@ public function testCustomTranslationTable()

$this->assertEquals('\TestApp\Model\Table\I18nTable', $i18n->name());
$this->assertInstanceOf('TestApp\Model\Table\I18nTable', $i18n->target());
$this->assertEquals('test_custom_i18n_datasource', $i18n->target()->connection()->configName());
$this->assertEquals('custom_i18n_table', $i18n->target()->table());
}

Expand Down
5 changes: 5 additions & 0 deletions tests/test_app/TestApp/Model/Table/I18nTable.php
Expand Up @@ -24,4 +24,9 @@ public function initialize(array $config)
{
$this->table('custom_i18n_table');
}

public static function defaultConnectionName()
{
return 'custom_i18n_datasource';
}
}

0 comments on commit 9514316

Please sign in to comment.