Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by JetBrains PhpStorm.
- * User: gorka
- * Date: 3/01/14
- * Time: 7:24
- */
- namespace Modelo\BLBundle\Tests\Controller;
- use Util\Constantes;
- require_once Constantes::ABSOLUTE_PATH_APPKERNEL_TEST;
- /**
- * Class BaseTestCase
- * @package Modelo\BLBundle\Tests\Controller
- */
- class BaseTestCase extends \PHPUnit_Framework_TestCase
- {
- private $container;
- private $app;
- private $em;
- /**
- * Function setUp
- */
- public function setUp()
- {
- $this->app = new \AppKernel('test', false);
- $this->app->boot();
- $this->container = $this->app->getContainer();
- $this->em = $this->container->get('doctrine')->getManager();
- $this->em->getConnection()->beginTransaction();
- parent::setUp();
- }
- /**
- * Function tearDown
- */
- public function tearDown()
- {
- $this->app->shutdown();
- $this->em->getConnection()->rollback();
- parent::tearDown();
- }
- /**
- * Function getContainer
- * </br>
- *
- * @return mixed
- */
- public function getContainer()
- {
- return $this->container;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement