main() публичный Метод

Execution method always used for tasks
public main ( string | null $type = null, string | null $name = null ) : void | array
$type string | null Class type.
$name string | null Name.
Результат void | array
Пример #1
0
 /**
  * Test main within a plugin.
  *
  * @return void
  */
 public function testMainPlugin()
 {
     $this->_loadTestPlugin('TestBake');
     $path = Plugin::path('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'));
     $this->Task->main('TestBake.Example');
 }
Пример #2
0
 /**
  * test execute with type and class name defined
  *
  * @return void
  */
 public function testExecuteWithAll()
 {
     $this->Task->expects($this->exactly(2))->method('createFile')->withConsecutive([$this->stringContains('TestCase' . DS . 'Model' . DS . 'Table' . DS . 'ArticlesTableTest.php'), $this->stringContains('class ArticlesTableTest extends TestCase')], [$this->stringContains('TestCase' . DS . 'Model' . DS . 'Table' . DS . 'CategoryThreadsTableTest.php'), $this->stringContains('class CategoryThreadsTableTest extends TestCase')]);
     $this->Task->params['all'] = true;
     $this->Task->main('Table');
 }