Created
June 14, 2011 21:18
-
-
Save wowo/1025913 to your computer and use it in GitHub Desktop.
Base test case with container (Symfony2)
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
<?php | |
require_once(__DIR__ . "/../../../../app/AppKernel.php"); | |
class BaseTestCase extends \PHPUnit_Framework_TestCase | |
{ | |
protected $_container; | |
public function __construct() | |
{ | |
$kernel = new \AppKernel("test", true); | |
$kernel->boot(); | |
$this->_container = $kernel->getContainer(); | |
parent::__construct(); | |
} | |
protected function get($service) | |
{ | |
return $this->_container->get($service); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment