Download the PHP package mvlabs/zf2behat-extension without Composer

On this page you can find all versions of the php package mvlabs/zf2behat-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zf2behat-extension

mvlabs/zf2behat-extension

Behat extension for Zend Framework 2 inspired by Symfony2extension by Konstantin Kudryashov.

Behat (http://behat.org/) is a php framework for Behavior Driven Development. This extension allows you to use it in your Zend Framework 2 projects. It initializes Behat, allowing you to quickly use your Gherking features within ZF2.

1.Requirements

This extension is installed through composer and has following dependencies:

Composer will take care of installing these for you (see below).

2.Installation

In order to install this extension, you only need to add the following in your Zend Framework 2 composer.json:

and then run composer.phar install (or update). At this point, you need to create a file named behat.yml in your application root folder with following content:

3.Usage

If you don't have an existing test suite, please proceed to 4.Initialization within a Module. Otherwise, you can use this extension within your existing test suite in 2 different ways:

  1. If you are using php version 5.4+, you can use MvLabs\Zf2BehatExtension\Context\Zf2Dictionary trait which provides basic ZendFramework 2 functionality. This functionality can only be used in one Context though.
  2. You can implement the MvLabs\Zf2BehatExtension\Context\Zf2AwareContextInterface for every context, avoiding to call parent context from subcontexts.

Both methods call a method setZf2App(Application $zf2Application) needed to set in a private property Zend\Mvc\Application to be reused on every step needed

4.Initialization inside a Module

In order to initialize your feature suite inside a Zend Framework 2 module, you need to execute:

So, for example, if you want to initialize the skeleton application, you could just do from your application root directory:

After the command is executed it will create a Features folder inside your module with a extension ready FeatureContext inside the Context subfolder. You should see following output in console:

5.Running your features

Now that you have your Features directory within your module source folder (module//src/) you can create your first feature file in Gherkin. Please refer to the official behat documentation (http://docs.behat.org/quick_intro.html#define-your-feature) to see how to create your first feature file.

At this point, you only need to run:

to run the feature against your module.

6.Feature profiles

If you often find yourself running a specific module suite it's possible to set a module parameter inside a profile in your behat.yml file like in the example below:

You can then just call behat without arguments:

Within a profile you can use a specific Zend Framework config/application.config.php file, through the following:

7.Multiple feature profiles

You can also use multiple profiles, such in the example below:

After setting those profiles, you can your Albums module suite executing:

8.Specific Feature Execution

You can run specific features specifying file name:

9.Appication Level Feature Suite

If you don't want to use module-centric structure it's possible maitain an application structure specifing a features path and context class in your behat.yml file like in the example:

Using this path you shuold only remember to add your context class in the autoloader.

10.Configuration Parameters

Supported options for profiles are:

  1. module - set the module to be runned for a specific profile (only one module per profile is currently supported)
  2. config - set a custom configuration file. if it is not specified config/application.config.php will be loaded

All versions of zf2behat-extension with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
behat/behat Version =2.4@stable
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mvlabs/zf2behat-extension contains the following files

Loading the files please wait ....