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

Execution method always used for tasks
public main ( string | null $name = null ) : void
$name string | null The name of the table to bake.
Результат void
Пример #1
0
 /**
  * test that execute passes with different inflections of the same name.
  *
  * @dataProvider nameVariations
  * @return void
  */
 public function testMainWithNamedModelVariations($name)
 {
     $this->Task->connection = 'test';
     $filename = $this->_normalizePath(APP . 'Model/Table/BakeArticlesTable.php');
     $this->Task->expects($this->at(0))->method('createFile')->with($filename, $this->stringContains('class BakeArticlesTable extends Table'));
     $this->Task->main($name);
 }
Пример #2
0
 /**
  * test main with plugin.name
  *
  * @return void
  */
 public function testMainWithPluginDot()
 {
     $this->Task->connection = 'test';
     Plugin::load('ControllerTest', ['path' => APP . 'Plugin/ControllerTest/']);
     $path = APP . 'Plugin/ControllerTest/src/Controller/BakeArticlesController.php';
     $this->Task->expects($this->at(1))->method('createFile')->with($this->_normalizePath($path), $this->stringContains('BakeArticlesController extends AppController'))->will($this->returnValue(true));
     $this->Task->main('ControllerTest.BakeArticles');
 }
Пример #3
0
 /**
  * Test that bake works
  *
  * @return void
  */
 public function testBake()
 {
     $this->Task->connection = 'test';
     $this->Task->expects($this->at(0))->method('createFile')->with($this->anything(), $this->logicalAnd($this->stringContains('class ArticlesFixture extends TestFixture'), $this->stringContains('public $fields'), $this->stringContains('public $records'), $this->logicalNot($this->stringContains('public $import'))));
     $result = $this->Task->main('Articles');
 }