diff --git a/lib/Cake/Model/AclNode.php b/lib/Cake/Model/AclNode.php index 1080b9a228b..4d62dea87c7 100644 --- a/lib/Cake/Model/AclNode.php +++ b/lib/Cake/Model/AclNode.php @@ -40,12 +40,12 @@ class AclNode extends Model { /** * Constructor */ - public function __construct() { + public function __construct($id = false, $table = null, $ds = null) { $config = Configure::read('Acl.database'); if (isset($config)) { $this->useDbConfig = $config; } - parent::__construct(); + parent::__construct($id, $table, $ds); } /** diff --git a/lib/Cake/Test/Case/Utility/ClassRegistryTest.php b/lib/Cake/Test/Case/Utility/ClassRegistryTest.php index d6d70774fa1..fc3fdb18be3 100644 --- a/lib/Cake/Test/Case/Utility/ClassRegistryTest.php +++ b/lib/Cake/Test/Case/Utility/ClassRegistryTest.php @@ -200,6 +200,19 @@ public function testAddModelWithAlias() $this->assertSame('RegisterArticleTag', $newTag->name); } +/** + * Test that init() can make the Aco models with alias set properly + * + * @return void + */ + public function testAddModelWithAliasAco() + { + $aco = ClassRegistry::init(array('class' => 'Aco', 'alias' => 'CustomAco')); + $this->assertInstanceOf('Aco', $aco); + $this->assertSame('Aco', $aco->name); + $this->assertSame('CustomAco', $aco->alias); + } + /** * testClassRegistryFlush method *