/** * Test baking within a plugin. * * @return void */ public function testBakePlugin() { $this->_loadTestPlugin('TestBake'); $path = Plugin::path('TestBake'); $this->Task->plugin = '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')); $result = $this->Task->bake('Example'); $this->assertSameAsFile(__FUNCTION__ . '.php', $result); }
/** * test bake() with a -plugin param * * @return void */ public function testBakeWithPlugin() { $this->Task->plugin = 'TestTest'; Plugin::load('TestTest', ['path' => APP . 'Plugin' . DS . 'TestTest' . DS]); $path = APP . 'Plugin/TestTest/tests/TestCase/View/Helper/FormHelperTest.php'; $path = str_replace('/', DS, $path); $this->Task->expects($this->once())->method('createFile')->with($path, $this->anything()); $this->Task->bake('Helper', 'Form'); }