Skip to content

Instantly share code, notes, and snippets.

View alexandresalome's full-sized avatar

Alexandre Salomé alexandresalome

View GitHub Profile
@alexandresalome
alexandresalome / bad_steps_proposition.php
Created June 7, 2011 19:48 — forked from everzet/bad_steps_proposition.php
Explaining why classes are not possible in Behat as step definitions
<?php
/*
You can't use classes like this to define steps by the simple reason:
in Behat and Cucumber, step definitions and test contexts ARE two
splitted logical elements, not one. Different step definitions
can be used together in different scenarios and each scenario will
have it's own context (environment) object. That's the main logical
idea behind Behat - define step once - use it everywhere.
<?
class Car
{
publc function __construct($id)
{
$this->id = $id;
}
/**