Behat\Behat\Context\Snippet\Generator\ContextSnippetGenerator::setContextIdentifier PHP Method

setContextIdentifier() public method

Sets target context identifier.
public setContextIdentifier ( Behat\Behat\Context\Snippet\Generator\TargetContextIdentifier $identifier )
$identifier Behat\Behat\Context\Snippet\Generator\TargetContextIdentifier
    public function setContextIdentifier(TargetContextIdentifier $identifier)
    {
        $this->contextIdentifier = new CachedContextIdentifier($identifier);
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $this->generator->setContextIdentifier(new AggregateContextIdentifier(array(new ContextInterfaceBasedContextIdentifier(), new FixedContextIdentifier($input->getOption('snippets-for')), new InteractiveContextIdentifier($this->translator, $input, $output))));
     $this->generator->setPatternIdentifier(new AggregatePatternIdentifier(array(new ContextInterfaceBasedPatternIdentifier(), new FixedPatternIdentifier($input->getOption('snippets-type')))));
 }