From 0a5bad65969193990bc458926fca3654cc5a00e2 Mon Sep 17 00:00:00 2001 From: Josh Lockhart Date: Tue, 16 Jun 2015 08:04:57 -0400 Subject: [PATCH] Add TableRegistry::get() options merge test case --- tests/TestCase/ORM/TableRegistryTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/TestCase/ORM/TableRegistryTest.php b/tests/TestCase/ORM/TableRegistryTest.php index 2ad367dff5b..ea4d6a762a3 100644 --- a/tests/TestCase/ORM/TableRegistryTest.php +++ b/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. *