/**
  * {@inheritDoc}
  * 
  * @see PHPUnit_Framework_TestCase::tearDownAfterClass()
  * 
  * @uses KernelTestCase::ensureKernelShutdown()
  */
 public static function tearDownAfterClass()
 {
     parent::ensureKernelShutdown();
     static::$repository->clear();
     static::$repository = null;
     // avoid memory leaks
 }
 protected function tearDown()
 {
     $purger = new ORMPurger($this->getDoctrine()->getManager());
     $purger->setPurgeMode(ORMPurger::PURGE_MODE_DELETE);
     $purger->purge();
     parent::tearDown();
 }
Example #3
0
 public static function tearDownAfterClass()
 {
     parent::tearDownAfterClass();
     if (static::$container instanceof ContainerInterface) {
         Path::remove(static::$container->getParameter('kernel.cache_dir'));
     }
 }
 /**
  * {@inheritDoc}
  * @see PHPUnit_Framework_TestCase::setUp()
  */
 public function setUp()
 {
     parent::setUp();
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->entityManager = self::$kernel->getContainer()->get('asf_user.user.manager');
 }
 protected function setUp()
 {
     parent::setUp();
     $this->bootKernel();
     $this->scheduler = self::$kernel->getContainer()->get('task.scheduler');
     $this->storage = self::$kernel->getContainer()->get('task.storage');
 }
Example #6
0
 /**
  * {@inheritDoc}
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->em->close();
     $this->em = null;
     // avoid memory leaks
 }
 /**
  * {@inheritDoc}
  */
 protected function tearDown()
 {
     parent::tearDown();
     if (!is_null($this->em)) {
         $this->em->close();
     }
 }
Example #8
0
 /**
  * @param array $options
  * @return AppKernel
  */
 protected static function createKernel(array $options = array())
 {
     /** @var AppKernel $kernel */
     $kernel = parent::createKernel($options);
     if (isset($options['prepare_doctrine']) && $options['prepare_doctrine'] === true) {
         $kernel->setPrepareDoctrineAfterBoot(true);
     }
     return $kernel;
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::bootKernel();
     $cachedir = self::$kernel->getCacheDir();
     static::$nonceDir = $cachedir . '/nonceDir';
     $fs = new Filesystem();
     $fs->mkdir(self::$nonceDir);
 }
Example #10
0
 /**
  * {@inheritDoc}
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->em->close();
     //cerrar emMod
     /*$this->emMod = static::$kernel->getContainer()
           ->get('doctrine')
           ->getManager();
       $this->emMod->close();*/
 }
 protected function setUp()
 {
     parent::setUp();
     $this->deleteTmpDir();
     static::bootKernel();
     $this->testCase = static::$kernel->getTestCase();
     if (is_null($this->util)) {
         $this->util = $this->createUtil();
     }
 }
 protected function tearDown()
 {
     unset($this->dm);
     $refl = new \ReflectionObject($this);
     foreach ($refl->getProperties() as $prop) {
         if (!$prop->isStatic() and 0 !== strpos($prop->getDeclaringClass()->getName(), 'PHPUnit_')) {
             $prop->setAccessible(true);
             $prop->setValue($this, null);
         }
     }
     parent::tearDown();
 }
Example #13
0
 /**
  * Provides a HttpClient based on the Graviton\AppKernel
  *
  * @todo why are we not using createClient from SymWebTestCase? This need fixing or an explanation.
  *
  * @param array $options environment and debug option for kernel
  * @param array $server  server params
  *
  * @return \Symfony\Bundle\FrameworkBundle\Client
  */
 protected static function createClient(array $options = array(), array $server = array())
 {
     WebTestCase::ensureKernelShutdown();
     if (null === KernelTestCase::$class) {
         KernelTestCase::$class = '\\Graviton\\' . static::getKernelClass();
     }
     WebTestCase::$kernel = new WebTestCase::$class(isset($options['environment']) ? $options['environment'] : 'test', isset($options['debug']) ? $options['debug'] : true);
     WebTestCase::$kernel->setBundleLoader(new BundleLoader(new GravitonBundleBundle()));
     WebTestCase::$kernel->boot();
     $client = WebTestCase::$kernel->getContainer()->get('test.client');
     $client->setServerParameters($server);
     return $client;
 }
 /**
  * {@inheritDoc}
  */
 protected function tearDown()
 {
     $this->em->rollback();
     parent::tearDown();
     $this->em->close();
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->consumer = $this->createMock(ConsumerInterface::class);
 }
 /**
  * {@inheritDoc}
  */
 public static function tearDownAfterClass()
 {
     self::$em->close();
     parent::tearDownAfterClass();
 }
Example #17
0
 /**
  *
  */
 protected function setUp()
 {
     self::bootKernel();
     $this->router = static::$kernel->getContainer()->get('router');
     parent::setUp();
 }
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     static::bootKernel();
     $this->validator = static::$kernel->getContainer()->get('validator');
 }
Example #19
0
 protected function tearDown()
 {
     `rm -rf {$this->compiled}`;
     parent::tearDown();
 }
 public function setUp()
 {
     parent::setUp();
     $setupFactory = new SetupFactory();
     static::$repository = $setupFactory->getRepository();
 }
 /**
  * {@inheritdoc}
  */
 protected static function bootKernel(array $options = [])
 {
     parent::bootKernel(array_merge(['debug' => false], $options));
 }
 /**
  * Cleans up the environment after running a test.
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->em->close();
     $this->registryRepository = null;
 }
 /**
  * @inheritdoc
  */
 public function tearDown()
 {
     parent::tearDown();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->bootKernel();
     $this->registry = self::$kernel->getContainer()->get('task.handler_registry');
 }
 public function tearDown()
 {
     // Shutdown the kernel.
     $this->myKernel->shutdown();
     parent::tearDown();
 }
Example #26
0
 public function tearDown()
 {
     $this->container->get('doctrine')->getConnection()->rollback();
     parent::tearDown();
     $this->container->get('doctrine')->getManager()->close();
 }
Example #27
0
 public function tearDown()
 {
     parent::tearDown();
     $this->dropAddedTables();
 }
 /**
  * {@inheritDoc}
  */
 public function teardown()
 {
     parent::tearDown();
     $this->em->close();
 }
 /**
  * {@inheritDoc}
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->em->close();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->bootKernel();
     $this->taskHandlerFactory = self::$kernel->getContainer()->get('task.handler.factory');
 }