This Cake 4 plugin comes with a snapshot and data seeds for the MySQL Sakila Sample Data. I found myself needing test data when I am creating new plugins and wanted something with complex enough relations for realistic development. While the SQL dump provided by MySQL is okay, it doesn't follow full Cake conventions. This plugin includes full cake conventions and additional schema improvements.
composer require cnizzardini/cakephp-sakila-plugin
bin/cake plugin load Sakila
Alternatively after composer installing you can manually load the plugin in your Application:
# src/Application.php
public function bootstrap(): void
{
// other logic...
$this->addPlugin('Sakila');
}
Run migrate and seed with -p Sakila
bin/cake migrations migrate -p Sakila
bin/cake migrations seed -p Sakila
You should now be able to bake a full application skeleton
bin/cake bake all --everything
Verify everything is working by running bin/cake server
See config/Migrations/20200422015732_Initial.php for full schema.
Unit tests ensure the schema can be built and seeders run. It uses cakephp/migrations
and SQLite for the data store.
vendor/bin/phpunit