Sulu\Bundle\TestBundle\Testing\SuluTestCase::tearDown PHP 메소드

tearDown() 공개 메소드

Close the database connection after the tests finish.
public tearDown ( )
    public function tearDown()
    {
        parent::tearDown();
        // close the doctrine connection
        foreach ($this->getContainer()->get('doctrine')->getConnections() as $connection) {
            $connection->close();
        }
        // close the jackalope connections - can be removed when
        // https://github.com/sulu/sulu/pull/2125 is merged.
        // this has a negligble impact on memory usage in anycase.
        foreach ($this->getContainer()->get('doctrine_phpcr')->getConnections() as $connection) {
            try {
                $connection->logout();
            } catch (\Exception $e) {
            }
        }
    }

Usage Example

예제 #1
0
 public function tearDown()
 {
     parent::tearDown();
     if (file_exists(self::$fixturePath . '/Export.en.xlf')) {
         unlink(self::$fixturePath . '/Export.en.xlf');
     }
     if (file_exists(self::$fixturePath . '/Export.en.json')) {
         unlink(self::$fixturePath . '/Export.en.json');
     }
 }