Project

cuke4php

0.04
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Using this protocol it is possible to directly interact with PHP code at any level without the need for a web server. To accomplish this, when cucumber is running against a directory containing feature files and it cannot resolve a particular step definition, it will ask a known wire server (as defined in a .wire file) to interpret and run those steps.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0

Runtime

>= 0.10.2
 Project Readme

cuke4php

This project implements the cucumber wire protocol for PHP projects. Information about the wire protocol: http://wiki.github.com/cucumber/cucumber/wire-protocol

Using this protocol it is possible to directly interact with PHP code at any level without the need for a web server. To accomplish this, when cucumber is running against a directory containing feature files and it cannot resolve a particular step definition, it will ask a known wire server (as defined in a .wire file) to interpret and run those steps.

Install

To install Cuke4Php, follow these steps:

[sudo] gem install cuke4php

Note: I realize the irony inherent in a gem being used to distribute PHP code.

Usage

  • run 'cuke4php path/to/features' from the command line

  • all parameters get passed to cucumber when it starts, but the last parameter on the command line should be the path to your features directory

  • make sure your cucumber features has a 'Cuke4Php.wire' file in step_definitions containing something like:

      host: localhost
      port: <%= ENV['CUKE4PHP_PORT'] %>
    
  • you can write both Ruby and PHP steps

  • you must require the PHPUnit library from a file in your features/support/ directory (e.g., features/support/Env.php) for cuke4php to work

Roadmap

bin/cuke4php

  • support an option like 'cuke4php --init' which will generate the directory structure and support files necessary to use cuke4php with a php project.
  • lint check all php files in features directory before starting the cuke4php server

Dependencies

Goals

This project utilizes PHPUnit because it has a robust set of assertions, has good mocking, and is widely used. This will facilitate adoption by developers who are already familiar with it.

This project was developed against the 5.2.x versions of PHP, to ensure compatibility with older PHP projects.

Support

Support for this project was provided by iContact, inc. (http://www.icontact.com)

Contributors