Bake\Shell\Task\ModelTask::bakeFixture PHP Метод

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

Interact with FixtureTask to automatically bake fixtures when baking models.
См. также: FixtureTask::bake
public bakeFixture ( string $className, string | null $useTable = null ) : void
$className string Name of class to bake fixture for
$useTable string | null Optional table name for fixture to use.
Результат void
    public function bakeFixture($className, $useTable = null)
    {
        if (!empty($this->params['no-fixture'])) {
            return;
        }
        $this->Fixture->connection = $this->connection;
        $this->Fixture->plugin = $this->plugin;
        $this->Fixture->bake($className, $useTable);
    }

Usage Example

Пример #1
0
 /**
  * Ensure that the fixture baking can be disabled
  *
  * @return void
  */
 public function testBakeFixtureDisabled()
 {
     $this->Task->params['no-fixture'] = true;
     $this->Task->plugin = 'TestBake';
     $this->Task->Fixture->expects($this->never())->method('bake');
     $this->Task->bakeFixture('BakeArticle', 'bake_articles');
 }