public function main($name = null) { parent::main(); $name = $this->_getName($name); if (empty($name)) { $this->out('Choose a model to bake from the following:'); foreach ($this->listUnskipped() as $table) { $this->out('- ' . $this->_camelize($table)); } return; } $this->bake($this->_camelize($name)); }
/** * test that execute passes with different inflections of the same name. * * @dataProvider nameVariations * @return void */ public function testMainWithNamedModelVariations($name) { $this->Task->connection = 'test'; $filename = $this->_normalizePath(APP . 'Model/Table/BakeArticlesTable.php'); $this->Task->expects($this->at(0))->method('createFile')->with($filename, $this->stringContains('class BakeArticlesTable extends Table')); $this->Task->main($name); }