/** * 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); }
/** * test main with plugin.name * * @return void */ public function testMainWithPluginDot() { $this->Task->connection = 'test'; Plugin::load('ControllerTest', ['path' => APP . 'Plugin/ControllerTest/']); $path = APP . 'Plugin/ControllerTest/src/Controller/BakeArticlesController.php'; $this->Task->expects($this->at(1))->method('createFile')->with($this->_normalizePath($path), $this->stringContains('BakeArticlesController extends AppController'))->will($this->returnValue(true)); $this->Task->main('ControllerTest.BakeArticles'); }
/** * Test that bake works * * @return void */ public function testBake() { $this->Task->connection = 'test'; $this->Task->expects($this->at(0))->method('createFile')->with($this->anything(), $this->logicalAnd($this->stringContains('class ArticlesFixture extends TestFixture'), $this->stringContains('public $fields'), $this->stringContains('public $records'), $this->logicalNot($this->stringContains('public $import')))); $result = $this->Task->main('Articles'); }