Browse Source

Add a test fo cell options.

This was missing previously.
mark_story 11 years ago
parent
commit
87568f2845

+ 11 - 0
tests/TestCase/View/CellTest.php

@@ -212,4 +212,15 @@ class CellTest extends TestCase {
 		$this->View->cell('Articles::nope');
 	}
 
+/**
+ * Test that cell options are passed on.
+ *
+ * @return void
+ */
+	public function testCellOptions() {
+		$cell = $this->View->cell('Articles', [], ['limit' => 10, 'nope' => 'nope']);
+		$this->assertEquals(10, $cell->limit);
+		$this->assertFalse(property_exists('nope', $cell), 'Not a valid option');
+	}
+
 }

+ 7 - 0
tests/test_app/TestApp/View/Cell/ArticlesCell.php

@@ -20,6 +20,13 @@ namespace TestApp\View\Cell;
 class ArticlesCell extends \Cake\View\Cell {
 
 /**
+ * valid cell options.
+ *
+ * @var array
+ */
+	protected $_validCellOptions = ['limit', 'page'];
+
+/**
  * Default cell action.
  *
  * @return void