Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luc45/database-dumper-for-codeception
Easily generates database dumps to be used in Codeception.
https://github.com/luc45/database-dumper-for-codeception
Last synced: 7 days ago
JSON representation
Easily generates database dumps to be used in Codeception.
- Host: GitHub
- URL: https://github.com/luc45/database-dumper-for-codeception
- Owner: Luc45
- License: mit
- Created: 2020-06-29T19:06:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-30T01:05:05.000Z (over 2 years ago)
- Last Synced: 2024-10-20T03:00:53.813Z (26 days ago)
- Language: PHP
- Size: 110 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Install
`composer require --dev lucasbustamante/db-dumper-for-codeception`
Add the command to your `codeception.yml`:
```
extensions:
commands:
- DumpGenerator\GenerateDump
```On a suite that uses a `Codeception\Modules\Db` module (or any module that extends `Db`), add these parameters:
```
modules:
config:
Db:
dump_dsn: 'mysql:host=%DUMP_DB_HOST%;dbname=%DUMP_DB_NAME%'
dump_user: '%DUMP_DB_USER%'
dump_password: '%DUMP_DB_PASSWORD%'
```Replace `%DUMP_DB_HOST%` and similars with your actual values. This should be your local development database, from which the dumps will be generated from.
# Usage
Run `./vendor/bin/codecept dump `
In the first run, a Dump config file will be generated at `tests/data/.sql.php` where you can fine-tune how your dump will be generated. On the subsequent runs, it will generate the dump based on the config. If you don't override any config, it will just do a full dump of the database.
This library is basically a Codeception wrapper around https://packagist.org/packages/ifsnop/mysqldump-php.
You can check their documentation to get more information on how exactly you can fine-tune your dump.