Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding tests to Component.test. Disproves #6459

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8200 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
commit 3e8e7a2a6f7223242efd5bb0a993e1801fff7d1f 1 parent a2a7727
@markstory markstory authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 cake/tests/cases/libs/controller/component.test.php
View
15 cake/tests/cases/libs/controller/component.test.php
@@ -436,6 +436,21 @@ function testComponentsWithParams() {
$this->assertEqual($Controller->Orange->settings, $expected);
$this->assertEqual($Controller->ParamTest->test, 'value');
}
+
+/**
+ * Ensure that settings are not duplicated when passed into component initialize.
+ *
+ * @return void
+ **/
+ function testComponentParamsNoDuplication() {
+ $Controller =& new ComponentTestController();
+ $Controller->components = array('Orange' => array('setting' => array('itemx')));
+
+ $Controller->constructClasses();
+ $Controller->Component->initialize($Controller);
+ $expected = array('setting' => array('itemx'), 'colour' => 'blood orange');
+ $this->assertEqual($Controller->Orange->settings, $expected, 'Params duplication has occured %s');
+ }
/**
* Test mutually referencing components.
*
Please sign in to comment.
Something went wrong with that request. Please try again.