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. *