diff --git a/tests/TestCase/ORM/TableTest.php b/tests/TestCase/ORM/TableTest.php index b5dd6130298..a64283a5054 100644 --- a/tests/TestCase/ORM/TableTest.php +++ b/tests/TestCase/ORM/TableTest.php @@ -1504,6 +1504,23 @@ class_alias($class, 'TestApp\Model\Entity\TestUser'); $this->assertEquals('TestApp\Model\Entity\TestUser', $table->getEntityClass()); } + /** + * Test that entity class inflection works for compound nouns + * + * @return void + */ + public function testEntityClassInflection() + { + $class = $this->getMockClass('\Cake\ORM\Entity'); + + if (!class_exists('TestApp\Model\Entity\CustomCookie')) { + class_alias($class, 'TestApp\Model\Entity\CustomCookie'); + } + + $table = $this->getTableLocator()->get('CustomCookies'); + $this->assertEquals('TestApp\Model\Entity\CustomCookie', $table->getEntityClass()); + } + /** * Tests that using a simple string for entityClass will try to * load the class from the Plugin namespace when using plugin notation diff --git a/tests/test_app/TestApp/Model/Table/CustomCookiesTable.php b/tests/test_app/TestApp/Model/Table/CustomCookiesTable.php new file mode 100644 index 00000000000..ce787303756 --- /dev/null +++ b/tests/test_app/TestApp/Model/Table/CustomCookiesTable.php @@ -0,0 +1,22 @@ +