Download the PHP package vierge-noire/cakephp-behat-suite without Composer
On this page you can find all versions of the php package vierge-noire/cakephp-behat-suite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vierge-noire/cakephp-behat-suite
More information about vierge-noire/cakephp-behat-suite
Files in vierge-noire/cakephp-behat-suite
Package cakephp-behat-suite
Short Description Test suite for behavior driven tests.
License MIT
Informations about the package cakephp-behat-suite
cakephp-behat-suite
A CakePHP dedicated suite for behavior driven development.
Installation
For CakePHP ^4.0:
For CakePHP ^3.8:
Setup
Copy this file in the main directory of your app, under the name `behat.yml:
The behat.yml
file is the equivalent to the PHPUnit's phpunit.xml
file. %paths.base%
points to your main directory.
Once your behat.yml
file has been created, run vendor/bin/behat --init
to automatically create the folders and Context
classes as defined in the config file.
You can define more suites additional to app, for example for your plugins.
IMPORTANT: the CakephpBehatSuite\Context\BootstrapContext
should be present in each of your suites.
The argument bootstrap:
should direct to the bootstrap.php
file of your tests.
For each suite, you will have to specify the location of your features under the key path
.
The package provides a set of steps defined by CakephpBehatSuite\Context\BootstrapContext
.
Run your tests
The command vendor/bin/behat
will run your tests as defined in the `behat.yml file.
Fixture factories
The package makes uses of the CakePHP fixture factories plugin. Make sure your factories are baked and working, in order to use the present package.
You will find the package and its documentation here.
The BootstrapContext class
The CakephpBehatSuite\Context\BootstrapContext
contains a set of steps, documented below.
The Context will ensure that the test database gets emptied before each scenario.
Example
Feature
This is how an integration on the edit action of your UsersController could be:
behat.yml with plugin
This behat file includes a suite for a dummy plugin MyCustomPlugin. For each suite, a Context has been added too.
Use Migrations
Take full advantage of the Phinx migrations in order to maintain the schema of your test DB. This is optional, but highly recommended.
The CakePHP Test Migrator package will assist you in doing this very simply.
License
The CakePHPFixtureFactories plugin is offered under an MIT license.
Copyright 2020 Juan Pablo Ramirez and Nicolas Masson
Licensed under The MIT License Redistributions of files must retain the above copyright notice.
Authors
- Juan Pablo Ramirez
- Nicolas Masson
All versions of cakephp-behat-suite with dependencies
cakephp/cakephp Version ^4.0
pakacuda/cakephp-fixture-factories Version ^2.0.3
vierge-noire/cakephp-test-suite-light Version ^2.0