Skip to content

Commit

Permalink
Merge pull request #72 from ifdattic/patch-3
Browse files Browse the repository at this point in the history
Change the reading flow of code example
  • Loading branch information
stof committed Feb 23, 2015
2 parents 9c03735 + daf2358 commit 6ae615d
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions guides/4.contexts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,33 @@ application behaves, then the context class is all about how to test it.
class FeatureContext implements Context
{
public function __construct($parameter)
{} // instantiate context
{
// instantiate context
}
/** @BeforeFeature */
public static function prepareForTheFeature()
{} // clean database or do other preparation stuff
{
// clean database or do other preparation stuff
}
/** @Given we have some context */
public function prepareContext()
{} // do something
{
// do something
}
/** @When event occurs */
public function doSomeAction()
{} // do something
{
// do something
}
/** @Then something should be done */
public function checkOutcomes()
{} // do something
{
// do something
}
}
A simple mnemonic for context classes is "testing features *in a context*".
Expand Down

0 comments on commit 6ae615d

Please sign in to comment.