public function main($type = null, $name = null) { parent::main(); if (empty($type) && empty($name)) { return $this->outputTypeChoices(); } if ($this->param('all')) { return $this->_bakeAll($type); } if (empty($name)) { return $this->outputClassChoices($type); } if ($this->bake($type, $name)) { $this->out('<success>Done</success>'); } }
/** * 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'); }