An open API service indexing awesome lists of open source software.

https://github.com/imjoehaines/flowdception

A Codeception Extension for Flowder
https://github.com/imjoehaines/flowdception

codeception fixture-loading fixtures flowder testing

Last synced: 27 days ago
JSON representation

A Codeception Extension for Flowder

Awesome Lists containing this project

README

        

# Flowdception [![Latest Stable Version](https://poser.pugx.org/imjoehaines/flowdception/v/stable)](https://packagist.org/packages/imjoehaines/flowdception) [![Build Status](https://travis-ci.org/imjoehaines/flowdception.svg?branch=master)](https://travis-ci.org/imjoehaines/flowdception) [![codecov](https://codecov.io/gh/imjoehaines/flowdception/branch/master/graph/badge.svg)](https://codecov.io/gh/imjoehaines/flowdception)

**Flowdception** is a Codeception Extension for integrating the [Flowder](https://github.com/imjoehaines/flowder) fixture loader into Codeception test suites.

## Usage

1. Install Flowdception as a development dependency through [Composer](https://getcomposer.org/)

```sh
$ composer install imjoehaines/flowdception --dev
```

2. Enable Flowdception as an extension in your main `codeception.yml`, or a specific suite's YAML configuration file (e.g. `integration.suite.yml`)

```yaml
extensions:
enabled:
- \Imjoehaines\Flowder\Codeception\Flowdception
```

3. Bootstrap Flowdception by calling `Flowdception::bootsrap` in one of your `_bootstrap.php` Codeception files, passing in an instance of `\Imjoehaines\Flowder\Flowder` (see the [Flowder documentation](https://github.com/imjoehaines/flowder) for more information).

A simple SQLite example might look like this:

```php
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

Flowdception::bootstrap(
__DIR__ . '/_data/example.php',
new PhpFileLoader(),
new SqliteTruncator($db),
new SqlitePersister($db)
);
```

4. That's it! Before any Codeception test file runs, Flowder will load your fixture data for you