Skip to content

Instantly share code, notes, and snippets.

@vdroznik
Last active December 10, 2015 07:38
Show Gist options
  • Save vdroznik/4402280 to your computer and use it in GitHub Desktop.
Save vdroznik/4402280 to your computer and use it in GitHub Desktop.
How to get Symfony2 services in functional test
/**
* @var \Doctrine\ORM\EntityManager
*/
private $em;
public function setUp()
{
static::$kernel = static::createKernel();
static::$kernel->boot();
$this->em = static::$kernel->getContainer()
->get('doctrine')
->getManager();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment