/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/bake/src/Command
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/bake/src/Command/FixtureAllCommand.php (3258B)
_setCommonOptions($parser);
$parser = $parser->setDescription(
'Generate all fixtures for use with the test suite.'
)->addOption('count', [
'help' => 'When using generated data, the number of records to include in the fixture(s).',
'short' => 'n',
'default' => 1,
])->addOption('schema', [
'help' => 'Create a fixture that imports schema, instead of dumping a schema snapshot into the fixture.',
'short' => 's',
'boolean' => true,
])->addOption('records', [
'help' => 'Generate a fixture with records from the non-test database.' .
' Used with --count and --conditions to limit which records are added to the fixture.',
'short' => 'r',
'boolean' => true,
])->addOption('conditions', [
'help' => 'The SQL snippet to use when importing records.',
'default' => '1=1',
]);
return $parser;
}
/**
* Execute the command.
*
* @param \Cake\Console\Arguments $args The command arguments.
* @param \Cake\Console\ConsoleIo $io The console io
* @return int|null
*/
public function execute(Arguments $args, ConsoleIo $io): ?int
{
$this->extractCommonProperties($args);
/** @var \Cake\Database\Connection $connection */
$connection = ConnectionManager::get($args->getOption('connection') ?? 'default');
$scanner = new TableScanner($connection);
$fixture = new FixtureCommand();
foreach ($scanner->listUnskipped() as $table) {
$fixtureArgs = new Arguments([$table], $args->getOptions(), ['name']);
$fixture->execute($fixtureArgs, $io);
}
return static::CODE_SUCCESS;
}
}