Skip to content

Commit

Permalink
Adding tests to Component.test. Disproves #6459
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8200 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
markstory committed Jun 21, 2009
1 parent a2a7727 commit 3e8e7a2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cake/tests/cases/libs/controller/component.test.php
Expand Up @@ -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.
*
Expand Down

0 comments on commit 3e8e7a2

Please sign in to comment.