Skip to content
Permalink
Browse files

Add TableRegistry::get() options merge test case

  • Loading branch information...
codeguy committed Jun 16, 2015
1 parent 803b0b7 commit 0a5bad65969193990bc458926fca3654cc5a00e2
Showing with 14 additions and 0 deletions.
  1. +14 −0 tests/TestCase/ORM/TableRegistryTest.php
@@ -222,6 +222,20 @@ public function testGetWithConfig()
$this->assertEquals('my_articles', $result->table(), 'Should use config() data.');
}
/**
* Test that get() uses config data `className` set with config()
*
* @return void
*/
public function testGetWithConfigClassName()
{
TableRegistry::config('MyUsersTableAlias', [
'className' => '\Cake\Test\TestCase\ORM\MyUsersTable',
]);
$result = TableRegistry::get('MyUsersTableAlias');
$this->assertInstanceOf('\Cake\Test\TestCase\ORM\MyUsersTable', $result, 'Should use config() data className option.');
}
/**
* Test get with config throws an exception if the alias exists already.
*

0 comments on commit 0a5bad6

Please sign in to comment.
You can’t perform that action at this time.