Gii fixture helper - generate fixture classes; faker templates; fixture data files from table support bulk template and data-file generations
composer require --dev --prefer-dist insolita/yii2-fixturegii "~3.0.0"
or add
"insolita/yii2-fixturegii": "~3.0.0"
to the require-dev section of your composer.json
file.
Register insolita\fixturegii\Bootstrap in bootstrap section of backend application, or add needed generators in section of gii module
Go to gii and use new Generators
Suggest:
define '@test' or '@fixture' alias for quick path setup
Set up in gii config sections
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
'generators' => [
//...
'fixtureClass'=>[
'class'=>\insolita\fixturegii\generators\ClassGenerator::class,
'templates'=>[
//add your custom
]
],
'fixtureData'=>[
'class'=>\insolita\fixturegii\generators\DataGenerator::class,
'tableResolverClass'=>'You can set own implementation',
'templates'=>[
//add your custom
]
],
'fixtureTemplate'=>[
'class'=>\insolita\fixturegii\generators\TemplateGenerator::class,
'tableResolverClass'=>'You can set own implementation',
'columnResolverClass'=>'You can set own implementation',
'templates'=>[
//add your custom
]
],
]
//...
];
1.0.0 - Separate generator in 3 classes; improve template generation, postgres support; structure improve
1.0.1 - Remove auto bootstrapping
1.0.2 - some strange with packagist
1.0.3 - fix postrgres resource for data generation
1.0.4 - bootstrap path fix, README fixes, style fixes from PR @MKiselev; faker resolver fixes
2.0.0 - support yii2 >=2.0.13 3.0.0 - update and checks with latest yii versions
Comments