Browse Source

Convert CellTask test to use bake_compare

AD7six 11 years ago
parent
commit
bc7381effd

+ 3 - 3
tests/TestCase/Shell/Task/CellTaskTest.php

@@ -123,9 +123,9 @@ class CellTaskTest extends TestCase {
 			);
 
 		$result = $this->Task->bake('Example');
-		$this->assertContains('namespace TestPlugin\View\Cell;', $result);
-		$this->assertContains('use Cake\View\Cell;', $result);
-		$this->assertContains('class ExampleCell extends Cell {', $result);
+
+		$expected = file_get_contents(CORE_TESTS . '/bake_compare/View/Cell/ExampleCell.php');
+		$this->assertTextEquals($expected, $result);
 	}
 
 }

+ 27 - 0
tests/bake_compare/View/Cell/ExampleCell.php

@@ -0,0 +1,27 @@
+<?php
+namespace TestPlugin\View\Cell;
+
+use Cake\View\Cell;
+
+/**
+ * Example cell
+ */
+class ExampleCell extends Cell {
+
+/**
+ * List of valid options that can be passed into this
+ * cell's constructor.
+ *
+ * @var array
+ */
+	protected $_validCellOptions = [];
+
+/**
+ * Default display method.
+ *
+ * @return void
+ */
+	public function display() {
+	}
+
+}