for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Behat\Tester\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode;
class SimpleFeatureContext implements Context, SnippetAcceptingContext {
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
/**
* @Given a value :value
*/
public function aValue($value) {
return $value;
}
* @Given values :value1 and :value2
public function valuesAnd($value1, $value2) {
return [$value1, $value2];
* @Then :a should equal :b
public function shouldEqual($a, $b) {
if ($a != $b) {
throw new \Exception("a ($a) does not equal b ($b)");
* @Then the database should contain:
public function theDatabaseShouldContain(PyStringNode $string) {
$string
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
throw new \Exception("My context has no way to access the database...");
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.