Download the PHP package vjik/codeception-db-populator without Composer
On this page you can find all versions of the php package vjik/codeception-db-populator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vjik/codeception-db-populator
More information about vjik/codeception-db-populator
Files in vjik/codeception-db-populator
Package codeception-db-populator
Short Description Database populator for Codeception DB module
License BSD-3-Clause
Informations about the package codeception-db-populator
Database Populator for Codeception DB Module
Codeception DB module addon that helps you to tune database populations. So for a test you could load only needed tables or rows. As a result it dramatically reduces the total execution time.
Requirements
- PHP 8.0 or higher.
- Codeception 5.0 or higher.
- Codeception Module DB 3.0 or higher.
Installation
The package could be installed with composer:
General usage
Enable module Db
and DatabasePopulator
addon in the suite:
Create SQL dumps that contains a record of the table structure and/or the data for use in tests.
Put dumps into path, specified in options (for example, tests/_data/dumps
).
Create row sets for populate database tables. Row sets is PHP file that return array in format table => rows
.
For example:
You can get structure, similar to this:
Load dumps and row sets in your tests:
Actions
loadDump()
Load the specified dump(s) to database. Before loading the dump, the database is cleaned.
loadRows()
Load the specified row set(s) to database.
Configuration
dumpsPath
(required) — relative path to directory with dumps (for example,tests/_dump
).rowsPath
(required) — relative path to directory with row sets (for example,tests/_rows
).preloadDump
— dump(s) for preload before run suite.preloadRows
— row set(s) for preload before run suite.
Testing
Unit and integration testing
The package is tested with Codeception. For tests need MySQL database with configuration:
- host:
127.0.0.1
- name:
db_test
- user:
root
- password:
root
To run tests:
Static analysis
The code is statically analyzed with Psalm. To run static analysis:
License
The Database Populator for Codeception DB Module is free software. It is released under the terms of the BSD License. Please see LICENSE
for more information.
All versions of codeception-db-populator with dependencies
ext-pdo Version *
codeception/codeception Version ^5.0
codeception/module-db Version ^3.0