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
- Host: GitHub
- URL: https://github.com/nojimage/codeception-cakefixture
- Owner: nojimage
- License: mit
- Created: 2017-12-08T11:10:48.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-05T02:39:39.000Z (almost 8 years ago)
- Last Synced: 2024-12-16T08:11:13.085Z (about 1 year ago)
- Topics: cakephp, codeception-module, fixture
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CakeFixture - CakePHP's Fixture loader for Codeception
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`