Пример #1
0
 /**
  * test generate with a missing template in the chosen template.
  * ensure fallback to default works.
  *
  * @return void
  */
 public function testGenerateWithTemplateFallbacks()
 {
     $this->_loadTestPlugin('TestBakeTheme');
     $this->Task->params['theme'] = 'TestBakeTheme';
     $this->Task->set(['name' => 'Articles', 'table' => 'articles', 'import' => false, 'records' => false, 'schema' => '', 'namespace' => '']);
     $result = $this->Task->generate('tests/fixture');
     $this->assertSameAsFile(__FUNCTION__ . '.ctp', $result);
 }
Пример #2
0
 /**
  * Get view instance
  *
  * @return \Cake\View\View
  * @triggers Bake.initialize $view
  */
 public function getView()
 {
     $bakeTemplates = dirname(dirname(dirname(__FILE__))) . DS . 'Template' . DS;
     $templateDirs = Configure::read('App.paths.templates');
     array_unshift($templateDirs, $bakeTemplates);
     Configure::write('App.paths.templates', $templateDirs);
     return parent::getView();
 }