コード例 #1
0
 public function tearDown()
 {
     foreach ($this->client->getContainer()->getMockedServices() as $id => $service) {
         $this->client->getContainer()->unmock($id);
     }
     m::close();
     parent::tearDown();
 }
コード例 #2
0
ファイル: TestCase.php プロジェクト: Algatux/symfony3.0
 /**
  * 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();
 }
コード例 #3
0
 /**
  * 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();
 }
コード例 #4
0
 /**
  * {@inheritDoc}
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->em->close();
 }
コード例 #5
0
 public function tearDown()
 {
     parent::tearDown();
     $this->client = null;
 }
コード例 #6
0
 public function tearDown()
 {
     parent::tearDown();
     unset($this->display);
 }
コード例 #7
0
 /**
  * {@inheritdoc}
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->em->close();
     unset($this->em, $this->container, $this->client, $this->encoder);
 }
コード例 #8
0
 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);
             }
         }
     }
 }
コード例 #9
0
 protected function tearDown()
 {
     $this->loadFixtures(array());
     $this->getContainer()->get('doctrine')->getConnection()->close();
     parent::tearDown();
 }
コード例 #10
0
 protected function tearDown()
 {
     parent::tearDown();
 }
コード例 #11
0
 /**
  * @inheritdoc
  */
 protected function tearDown()
 {
     self::runCommand('doctrine:schema:drop', ['--force' => true]);
     parent::tearDown();
 }
コード例 #12
0
 public function tearDown()
 {
     $this->runCommand('doctrine:database:drop', array('--force' => true));
     parent::tearDown();
 }
コード例 #13
0
 /**
  * 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();
 }
コード例 #14
0
 /**
  * {@inheritdoc}
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->getContainer()->get('doctrine')->getManager()->close();
 }