|
|
@@ -260,6 +260,8 @@ class TestTaskTest extends TestCase {
|
|
|
['component', 'AuthComponent', 'App\Controller\Component\AuthComponent'],
|
|
|
['Shell', 'Example', 'App\Console\Command\ExampleShell'],
|
|
|
['shell', 'Example', 'App\Console\Command\ExampleShell'],
|
|
|
+ ['Cell', 'Example', 'App\View\Cell\ExampleCell'],
|
|
|
+ ['cell', 'Example', 'App\View\Cell\ExampleCell'],
|
|
|
];
|
|
|
}
|
|
|
|
|
|
@@ -308,6 +310,27 @@ class TestTaskTest extends TestCase {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Test baking a test for a cell.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testBakeCellTest() {
|
|
|
+ $this->Task->expects($this->once())
|
|
|
+ ->method('createFile')
|
|
|
+ ->will($this->returnValue(true));
|
|
|
+
|
|
|
+ $result = $this->Task->bake('Cell', 'Articles');
|
|
|
+
|
|
|
+ $this->assertContains("use App\View\Cell\ArticlesCell", $result);
|
|
|
+ $this->assertContains('class ArticlesCellTest extends TestCase', $result);
|
|
|
+
|
|
|
+ $this->assertContains('function setUp()', $result);
|
|
|
+ $this->assertContains("\$this->request = \$this->getMock('Cake\Network\Request')", $result);
|
|
|
+ $this->assertContains("\$this->response = \$this->getMock('Cake\Network\Response')", $result);
|
|
|
+ $this->assertContains("\$this->Articles = new ArticlesCell(\$this->request, \$this->response", $result);
|
|
|
+ }
|
|
|
+
|
|
|
+/**
|
|
|
* Test baking a test for a concrete model.
|
|
|
*
|
|
|
* @return void
|