/** * test bake() with a -plugin param * * @return void */ public function testBakeEntityWithPlugin() { $this->Task->plugin = 'ModelTest'; // fake plugin path Plugin::load('ModelTest', ['path' => APP . 'Plugin' . DS . 'ModelTest' . DS]); $path = APP . 'Plugin' . DS . 'ModelTest' . DS . 'src' . DS . 'Model' . DS . 'Entity' . DS . 'BakeArticle.php'; $path = $this->_normalizePath($path); $this->Task->expects($this->once())->method('createFile')->with($path); $model = TableRegistry::get('BakeArticles'); $result = $this->Task->bakeEntity($model); $this->assertSameAsFile(__FUNCTION__ . '.php', $result); }