Method | Description | |
---|---|---|
__construct ( Behat\Behat\Definition\Pattern\PatternTransformer $patternTransformer ) | Initializes snippet generator. | |
generateSnippet ( Behat\Testwork\Environment\Environment $environment, Behat\Gherkin\Node\StepNode $step ) | ||
setContextIdentifier ( Behat\Behat\Context\Snippet\Generator\TargetContextIdentifier $identifier ) | Sets target context identifier. | |
setPatternIdentifier ( Behat\Behat\Context\Snippet\Generator\PatternIdentifier $identifier ) | Sets target pattern type identifier. | |
supportsEnvironmentAndStep ( Behat\Testwork\Environment\Environment $environment, Behat\Gherkin\Node\StepNode $step ) |
Method | Description | |
---|---|---|
deduceMethodName ( string $canonicalText ) : string | Generates definition method name based on the step text. | |
getAlreadyProposedMethods ( string $contextClass ) : string[] | Returns already proposed method names. | |
getMethodArgument ( string $argument ) : string | Returns method argument. | |
getMethodArguments ( Behat\Gherkin\Node\StepNode $step, integer $tokenCount ) : string[] | Returns an array of method argument names from step and token count. | |
getMethodName ( string $contextClass, string $canonicalText, string $pattern ) : string | Generates method name using step text and regex. | |
getMethodNameNotExistentInContext ( ReflectionClass $reflection, string $methodName, integer $methodNumber ) : array | Tries to guess method name that is not yet defined in the context class. | |
getMethodNameNotProposedEarlier ( string $contextClass, string $stepPattern, string $name, integer $number ) : string | Tries to guess method name that is not yet proposed to the context class. | |
getMethodNumberFromTheMethodName ( string $methodName ) : integer | Tries to deduct method number from the provided method name. | |
getSnippetTemplate ( string $pattern, string $methodName, array $methodArguments ) : string | Generates snippet template using regex, method name and arguments. | |
getUniqueMethodName ( string $contextClass, string $stepPattern, string $name ) : string | Ensures uniqueness of the method name in the context. | |
getUsedClasses ( Behat\Gherkin\Node\StepNode $step ) : string[] | Returns an array of classes used by the snippet template | |
markMethodAsAlreadyProposed ( string $contextClass, string $stepPattern, string $methodName ) | Marks method as proposed one. |
public __construct ( Behat\Behat\Definition\Pattern\PatternTransformer $patternTransformer ) | ||
$patternTransformer | Behat\Behat\Definition\Pattern\PatternTransformer |
public generateSnippet ( Behat\Testwork\Environment\Environment $environment, Behat\Gherkin\Node\StepNode $step ) | ||
$environment | Behat\Testwork\Environment\Environment | |
$step | Behat\Gherkin\Node\StepNode |
public setContextIdentifier ( Behat\Behat\Context\Snippet\Generator\TargetContextIdentifier $identifier ) | ||
$identifier | Behat\Behat\Context\Snippet\Generator\TargetContextIdentifier |
public setPatternIdentifier ( Behat\Behat\Context\Snippet\Generator\PatternIdentifier $identifier ) | ||
$identifier | Behat\Behat\Context\Snippet\Generator\PatternIdentifier |
public supportsEnvironmentAndStep ( Behat\Testwork\Environment\Environment $environment, Behat\Gherkin\Node\StepNode $step ) | ||
$environment | Behat\Testwork\Environment\Environment | |
$step | Behat\Gherkin\Node\StepNode |