Skip to Main Content
Cucumber Recipes
book

Cucumber Recipes

by Ian Dees, Matt Wynne, Aslak Hellesoy
February 2013
Intermediate to advanced content levelIntermediate to advanced
272 pages
5h 45m
English
Pragmatic Bookshelf
Content preview from Cucumber Recipes
Recipe 33Test a PHP App with cuke4php

Problem

You want to be able to run quick tests of your PHP app without the overhead of launching a browser.

Ingredients

  • PHP 5.3.x[213]

  • Cuke4php,[214] a tool for writing step definitions in PHP

  • Cucumber’s wire protocol,[215] used behind the scenes by Cuke4php

  • The PHPUnit test framework[216] for assertions

  • (Optional) An environment for running full browser tests afterward: Selenium, Firefox, and a web server

Solution

You’re probably testing your PHP app at a few different layers. At the bottom layer, you may be using PHPUnit to test individual classes and functions. At the top layer, you might have something like Selenium for testing the app in a live browser.

Cuke4php sits somewhere in the middle. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cucumber Cookbook

Cucumber Cookbook

Shankar Garg
Basiswissen Softwaretest , 6th Edition

Basiswissen Softwaretest , 6th Edition

Andreas Spillner, Tilo Linz
React Cookbook

React Cookbook

David Griffiths, Dawn Griffiths

Publisher Resources

ISBN: 9781941222607Errata