Skip to content
This repository
Browse code

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
Mark Story authored June 21, 2009
15  cake/tests/cases/libs/controller/component.test.php
@@ -436,6 +436,21 @@ function testComponentsWithParams() {
436 436
 		$this->assertEqual($Controller->Orange->settings, $expected);
437 437
 		$this->assertEqual($Controller->ParamTest->test, 'value');
438 438
 	}
  439
+
  440
+/**
  441
+ * Ensure that settings are not duplicated when passed into component initialize.
  442
+ *
  443
+ * @return void
  444
+ **/
  445
+	function testComponentParamsNoDuplication() {
  446
+		$Controller =& new ComponentTestController();
  447
+		$Controller->components = array('Orange' => array('setting' => array('itemx')));
  448
+
  449
+		$Controller->constructClasses();
  450
+		$Controller->Component->initialize($Controller);
  451
+		$expected = array('setting' => array('itemx'), 'colour' => 'blood orange');
  452
+		$this->assertEqual($Controller->Orange->settings, $expected, 'Params duplication has occured %s');
  453
+	}
439 454
 /**
440 455
  * Test mutually referencing components.
441 456
  *

0 notes on commit 3e8e7a2

Please sign in to comment.
Something went wrong with that request. Please try again.