Skip to content

Instantly share code, notes, and snippets.

@weaverryan
Created January 9, 2013 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weaverryan/4496325 to your computer and use it in GitHub Desktop.
Save weaverryan/4496325 to your computer and use it in GitHub Desktop.
Using KernelAwareInterface
<?php
// ..
use Behat\Symfony2Extension\Context\KernelAwareInterface;
use Symfony\Component\HttpKernel\KernelInterface;
class FeatureContext extends MinkContext implements KernelAwareInterface
{
private $kernel;
public function setKernel(KernelInterface $kernel)
{
$this->kernel = $kernel;
}
protected function getContainer()
{
return $this->kernel->getContainer();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment