public function tearDown() { foreach ($this->client->getContainer()->getMockedServices() as $id => $service) { $this->client->getContainer()->unmock($id); } m::close(); parent::tearDown(); }
/** * Do not EVER forget to call parent::tearDown() if you override this method! */ public function tearDown() { if ($this->getEntityManager()) { $this->getEntityManager()->rollback(); $conn = $this->getEntityManager()->getConnection(); $conn->close(); } parent::tearDown(); }
/** * Do not EVER forget to call parent::tearDown() if you override this method! */ public function tearDown() { /** @var EntityManagerInterface $manager */ foreach ($this->getContainer()->get('doctrine')->getManagers() as $manager) { $manager->rollback(); $manager->close(); $connection = $manager->getConnection(); if ($connection instanceof \ParaunitTestCase\Connection\Connection) { $connection->closeForReal(); } elseif (method_exists($connection, 'close')) { $connection->close(); } } parent::tearDown(); }
/** * {@inheritDoc} */ protected function tearDown() { parent::tearDown(); $this->em->close(); }
public function tearDown() { parent::tearDown(); $this->client = null; }
public function tearDown() { parent::tearDown(); unset($this->display); }
/** * {@inheritdoc} */ protected function tearDown() { parent::tearDown(); $this->em->close(); unset($this->em, $this->container, $this->client, $this->encoder); }
public function tearDown() { parent::tearDown(); $this->em->clear(); $this->em->close(); foreach ($this->dataFiles() as $src => $dst) { $path = self::DSTDIR . '/' . $dst; if (file_exists($path)) { if (is_dir($path)) { $this->delTree($path); } else { unlink($path); } } } }
protected function tearDown() { $this->loadFixtures(array()); $this->getContainer()->get('doctrine')->getConnection()->close(); parent::tearDown(); }
protected function tearDown() { parent::tearDown(); }
/** * @inheritdoc */ protected function tearDown() { self::runCommand('doctrine:schema:drop', ['--force' => true]); parent::tearDown(); }
public function tearDown() { $this->runCommand('doctrine:database:drop', array('--force' => true)); parent::tearDown(); }
/** * Test postModerate hook */ public function testPostModerate() { self::bootKernel(); /** @var \Doctrine\ORM\EntityManager $em */ $em = static::$kernel->getContainer()->get('doctrine')->getManager(); $this->loadFixtures(['AppBundle\\DataFixtures\\ORM\\LoadCategoryData', 'AppBundle\\DataFixtures\\ORM\\LoadUserData']); // Find some category and user $category = $em->getRepository('AppBundle:Category')->findOneBy(['level' => 1]); $user = $em->getRepository('AppBundle:User')->findOneBy(['enabled' => 1]); $item = (new Item())->setTitle('phone')->setCategory($category)->setLatitude(49.437764)->setLongitude(27.005755)->setType(ItemTypeType::LOST)->setAreaType(ItemAreaTypeType::MARKER)->setDescription('description')->setDate(new \DateTime('10.11.2014'))->setCreatedBy($user); $em->persist($item); $em->flush(); // Null by default $this->assertNull($item->getModeratedAt()); $item->setModerated(true); // Set moderation $em->flush(); // Current date and time after moderation, must be DateTime object $this->assertInstanceOf('DateTime', $item->getModeratedAt()); parent::tearDown(); $em->close(); }
/** * {@inheritdoc} */ protected function tearDown() { parent::tearDown(); $this->getContainer()->get('doctrine')->getManager()->close(); }