本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Test\WebTestCase::tearDown方法的典型用法代码示例。如果您正苦于以下问题:PHP WebTestCase::tearDown方法的具体用法?PHP WebTestCase::tearDown怎么用?PHP WebTestCase::tearDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Bundle\FrameworkBundle\Test\WebTestCase
的用法示例。
在下文中一共展示了WebTestCase::tearDown方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
/**
* {@inheritDoc}
*/
protected function tearDown()
{
parent::tearDown();
if ($this->em instanceof \Doctrine\ORM\EntityManager) {
$this->em->close();
}
}
示例2: tearDown
public function tearDown()
{
if ($this->container !== null) {
$this->container->get('doctrine')->getConnection()->close();
}
parent::tearDown();
}
示例3: tearDown
protected function tearDown()
{
$this->truncateTables();
$this->nullifyProperties();
parent::tearDown();
static::$kernel = null;
}
示例4: tearDown
/**
* {@inheritDoc}
*/
protected function tearDown()
{
parent::tearDown();
if ($this->em) {
$this->em->close();
}
}
示例5: tearDown
protected function tearDown()
{
parent::tearDown();
foreach (glob($this->webDir . '/*{.xml,.xml.gz}', GLOB_BRACE) as $file) {
unlink($file);
}
}
示例6: tearDown
protected function tearDown()
{
//Close & unsets
if (is_object($this->em)) {
$this->em->getConnection()->close();
$this->em->close();
}
unset($this->em);
unset($this->container);
unset($this->kern);
unset($this->client);
//Nettoyage des mocks
//http://kriswallsmith.net/post/18029585104/faster-phpunit
$refl = new \ReflectionObject($this);
foreach ($refl->getProperties() as $prop) {
if (!$prop->isStatic() && 0 !== strpos($prop->getDeclaringClass()->getName(), 'PHPUnit_')) {
$prop->setAccessible(true);
$prop->setValue($this, null);
}
}
//Nettoyage du garbage
if (!gc_enabled()) {
gc_enable();
}
gc_collect_cycles();
//Parent
parent::tearDown();
}
示例7: tearDown
/**
* Cleans up the environment after running a test.
*/
protected function tearDown()
{
$this->ipBannedRepository = null;
$this->ipBanned = null;
$this->em = null;
parent::tearDown();
}
示例8: tearDown
public function tearDown()
{
NullPersister::$incrementTotalAccessCalled = false;
NullPersister::$incrementRepositoryAccessCalled = false;
NullPersister::$addRepositoryToLatestAccessedCalled = false;
NullPersister::$incrementRepositoryAccessTypeCalled = false;
parent::tearDown();
}
示例9: tearDown
public function tearDown()
{
foreach ($this->client->getContainer()->getMockedServices() as $id => $service) {
$this->client->getContainer()->unmock($id);
}
\Mockery::close();
$this->client = null;
parent::tearDown();
}
示例10: tearDown
/**
* {@inheritdoc}
*/
protected function tearDown()
{
$this->rollbackTransaction();
BaseWebTestCase::tearDown();
static::$client = null;
static::$container = null;
static::$kernel = null;
$this->cleanFixtures();
}
示例11: tearDown
public function tearDown()
{
/*
* Close doctrine connections to avoid having a 'too many connections'
* message when running many tests
*/
$this->container->get('doctrine')->getConnection()->close();
parent::tearDown();
}
示例12: tearDown
public function tearDown()
{
parent::tearDown();
$this->client = null;
$this->container = null;
$this->listener = null;
$this->service = null;
$this->resolver = null;
}
示例13: tearDown
/**
* {@inheritdoc}
*/
public function tearDown()
{
if (!self::$shareWorkspace && null !== self::$workspace) {
$filesystem = new Filesystem();
$filesystem->remove(self::$workspace);
self::$workspace = null;
TestHomePathDeterminator::resetPath();
}
parent::tearDown();
}
示例14: tearDown
/**
* Tear down
*/
public function tearDown()
{
if (!static::$application) {
return;
}
$output = new BufferedOutput();
static::$application->run(new ArrayInput(array('command' => 'doctrine:database:drop', '--no-interaction' => true, '--force' => true, '--quiet' => true)), $output);
if (!$this->runCommandsQuietly()) {
echo $output->fetch();
}
parent::tearDown();
}
示例15: tearDown
protected function tearDown()
{
// we can't simply do "$client->shutdown()" because sometimes
// when an integration test fails (e.g. due to an error in the
// container configuration) the $client property is set to null
// (by PHPUnit?) and the original error is hidden behind a fatal
// "Call to a member function shutdown() on a non-object"...
if ($this->client instanceof TransactionalTestClient) {
$this->client->shutdown();
}
parent::tearDown();
}