diff --git a/lib/Cake/Model/AclNode.php b/lib/Cake/Model/AclNode.php index 1080b9a22..4d62dea87 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 d6d70774f..fc3fdb18b 100644 --- a/lib/Cake/Test/Case/Utility/ClassRegistryTest.php +++ b/lib/Cake/Test/Case/Utility/ClassRegistryTest.php @@ -200,6 +200,19 @@ class ClassRegistryTest extends CakeTestCase { $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 *