Last active
December 10, 2015 07:38
-
-
Save vdroznik/4402280 to your computer and use it in GitHub Desktop.
How to get Symfony2 services in functional test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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