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

https://github.com/nojimage/codeception-cakefixture

CakePHP's Fixture loader for Codeception
https://github.com/nojimage/codeception-cakefixture

cakephp codeception-module fixture

Last synced: about 1 month ago
JSON representation

CakePHP's Fixture loader for Codeception

Awesome Lists containing this project

README

          

# CakeFixture - CakePHP's Fixture loader for Codeception



Software License


Build Status


Latest Stable Version

This Codeception module can be able load [CakePHP Fixutre](https://book.cakephp.org/3.0/en/development/testing.html#fixtures) in your test case.

## Installation

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require --dev elstc/codeception-cakefixture
```

Then enable this module in your test suite configration file (eg: `acceptance.suite.yml`, `functional.suite.yml`, and etc...):

```
modules:
enabled:
- CakeFixture
```

See: [06-ModulesAndHelpers - Codeception - Documentation](http://codeception.com/docs/06-ModulesAndHelpers)

If you have not yet read the CakePHP bootstrap file with in the Codeception bootstrap, then load it:

```php
loadFixtures('Users', 'Posts');
// or load all fixtures
$I->loadFixtures();
// ...
}
}
```

### Cept

In your `Cept` test case, use `$I->useFixtures()` and `$I->loadFixtures()`:

```php
$I = new FunctionalTester($scenario);

// You should call `useFixtures` before `loadFixtures`
$I->useFixtures('app.users', 'app.posts');
// Then load fixtures manually
$I->loadFixtures('Users', 'Posts');
// or load all fixtures
$I->loadFixtures();
```

## Configuration options

#### `debug`

Pass to FixtureManager's debug option.

default: `false`

#### `autoFixures`

Default `$autoFixtures` property.

default: `true`

#### `dropTables`

Default `$dropTables` property.

default: `true`