Browse Source

Adding test for lazy loading helpers in views

Jose Lorenzo Rodriguez 14 years ago
parent
commit
c270e7ffda
1 changed files with 14 additions and 0 deletions
  1. 14 0
      lib/Cake/Test/Case/View/ViewTest.php

+ 14 - 0
lib/Cake/Test/Case/View/ViewTest.php

@@ -797,6 +797,20 @@ class ViewTest extends CakeTestCase {
 		$this->assertInstanceOf('FormHelper', $View->Form, 'Object type is wrong.');
 	}
 
+
+/**
+ * test lazy loading helpers
+ *
+ * @return void
+ */
+	public function testLazyLoadHelpers() {
+		$View = new View($this->PostsController);
+
+		$View->helpers = array();
+		$this->assertInstanceOf('HtmlHelper', $View->Html, 'Object type is wrong.');
+		$this->assertInstanceOf('FormHelper', $View->Form, 'Object type is wrong.');
+	}
+
 /**
  * test the correct triggering of helper callbacks
  *