Skip to content

Commit

Permalink
Add TableRegistry::get() options merge test case
Browse files Browse the repository at this point in the history
  • Loading branch information
codeguy committed Jun 16, 2015
1 parent 803b0b7 commit 0a5bad6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/TestCase/ORM/TableRegistryTest.php
Expand Up @@ -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.
*
Expand Down

0 comments on commit 0a5bad6

Please sign in to comment.