The PHPDoc comment of method should satisfy the next rules:
/**
* Method description can occupy as many rows as necessary. After description
* must be an empty line.
*
* @see Context::method()
* @see Context::additionalMethod()
*
* @link https://github.com/BR0kEN-/behat-drupal-propeople-context
*
* @example
* Description of the example section.
*
* @param string $parameter1
* The description of a parameter1. It should be indented by two spaces. Each
* line of multiline description should be indented too.
* @param string $parameter2
* The description of a parameter2.
*
* @throws \Exception
* @throws \RuntimeException
* The description of exception should satisfy the similar rules as for parameters,
* but should be added only if it implicit and throw in another function or method.
*
* @return \stdClass
*
* @Given /^Regex of the Behat step definition$/
*/
Each context are accessible from another by help of PHP overloading. If you want to get
the FormContext
in UserContext
then you just need to call specific method: getFormContext
. In
this way, method like get[ContextName]
return necessary object.
All context objects automatically added to Behat environment in TqContextReader::readEnvironmentCallees
method. The RecursiveDirectoryIterator
iterates the folder with contexts and load file if it name satisfy the
[ContextName]Context.php
.