/** * Test main within a plugin. * * @return void */ public function testMainPlugin() { $this->_loadTestPlugin('TestBake'); $path = Plugin::path('TestBake'); $this->Task->expects($this->at(0))->method('createFile')->with($this->_normalizePath($path . 'src/Template/Cell/Example/display.ctp'), ''); $this->Task->expects($this->at(1))->method('createFile')->with($this->_normalizePath($path . 'src/View/Cell/ExampleCell.php'), $this->stringContains('class ExampleCell extends Cell')); $this->Task->main('TestBake.Example'); }
/** * test execute with type and class name defined * * @return void */ public function testExecuteWithAll() { $this->Task->expects($this->exactly(2))->method('createFile')->withConsecutive([$this->stringContains('TestCase' . DS . 'Model' . DS . 'Table' . DS . 'ArticlesTableTest.php'), $this->stringContains('class ArticlesTableTest extends TestCase')], [$this->stringContains('TestCase' . DS . 'Model' . DS . 'Table' . DS . 'CategoryThreadsTableTest.php'), $this->stringContains('class CategoryThreadsTableTest extends TestCase')]); $this->Task->params['all'] = true; $this->Task->main('Table'); }