Beispiel #1
0
 /**
  * test bake all
  *
  * @return void
  */
 public function testAllWithModelName()
 {
     $this->Shell->Model = $this->getMock('Bake\\Shell\\Task\\ModelTask');
     $this->Shell->Controller = $this->getMock('Bake\\Shell\\Task\\ControllerTask');
     $this->Shell->Template = $this->getMock('Bake\\Shell\\Task\\TemplateTask');
     $this->Shell->Model->expects($this->once())->method('main')->with('Comments')->will($this->returnValue(true));
     $this->Shell->Controller->expects($this->once())->method('main')->with('Comments')->will($this->returnValue(true));
     $this->Shell->Template->expects($this->once())->method('main')->with('Comments');
     $this->Shell->connection = '';
     $this->Shell->params = ['prefix' => 'account'];
     $this->Shell->all('Comments');
     $output = $this->out->messages();
     $expected = ['Bake All', '---------------------------------------------------------------', '<success>Bake All complete.</success>'];
     $this->assertSame($expected, $output);
 }
Beispiel #2
0
 public function all($name = null, $test = null)
 {
     $this->Model = $this->AutoModel;
     $this->Controller = $this->AutoController;
     $this->Template = $this->AutoTemplate;
     if (!isset($this->params['prefix']) || !$this->params['prefix']) {
         $prefix = $this->in('No ha seleccionado un prefijo, desea que el prefijo sea "admin"?', ['y', 'n'], 'y');
         if ($prefix === 'y') {
             $this->params['prefix'] = 'admin';
         }
     }
     return parent::all($name, $test);
 }