PHPackages                             punktde/codeception-database - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. punktde/codeception-database

ActiveLibrary[Testing &amp; Quality](/categories/testing)

punktde/codeception-database
============================

Provides a module and gherkin steps to use databases for codeception testing

3.2.0(1y ago)025.3k↓31.6%GPL-3.0-or-laterPHP

Since Jul 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/punktDe/codeception-database)[ Packagist](https://packagist.org/packages/punktde/codeception-database)[ RSS](/packages/punktde-codeception-database/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (4)Versions (10)Used By (0)

punktde/codeception-database
============================

[](#punktdecodeception-database)

Gherkin Steps and additional module functions for the Codeception Database module
---------------------------------------------------------------------------------

[](#gherkin-steps-and-additional-module-functions-for-the-codeception-database-module)

### How to use

[](#how-to-use)

#### Extended module

[](#extended-module)

Use the module `PunktDe\Codeception\Database\Module\Database` instead of the default codeception module `db` in your `codeception.yaml`:

```
modules:
   enabled:
      - PunktDe\Codeception\Database\Module\Database:
         dsn: 'mysql:host=localhost;dbname=testdb'
         user: 'root'
         password: ''
         dump: 'tests/_data/dump.sql'
         populate: true
         cleanup: true
         reconnect: true
         waitlock: 10
         ssl_key: '/path/to/client-key.pem'
         ssl_cert: '/path/to/client-cert.pem'
         ssl_ca: '/path/to/ca-cert.pem'
         ssl_verify_server_cert: false
         ssl_cipher: 'AES256-SHA'
         initial_queries:
             - 'CREATE DATABASE IF NOT EXISTS temp_db;'
             - 'USE temp_db;'
             - 'SET NAMES utf8;'

```

#### Gherkin steps

[](#gherkin-steps)

Just add the trait `PunktDe\Codeception\Database\ActorTraits\Database` to your testing actor. Then you can use `*.feature` files to write your gherkin tests with the new steps.

##### Example actor

[](#example-actor)

```
