本文整理汇总了PHP中WebTestCase::tearDown方法的典型用法代码示例。如果您正苦于以下问题:PHP WebTestCase::tearDown方法的具体用法?PHP WebTestCase::tearDown怎么用?PHP WebTestCase::tearDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebTestCase
的用法示例。
在下文中一共展示了WebTestCase::tearDown方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
protected function tearDown()
{
parent::tearDown();
$pluginSettingsDao = DAORegistry::getDAO('PluginSettingsDAO');
/* @var $pluginSettingsDao PluginSettingsDAO */
$pluginSettingsDao->_getCache(0, 'luceneplugin')->flush();
}
示例2: tearDown
/**
* @see PHPUnit_Framework_TestCase::tearDown()
*/
protected function tearDown()
{
// Restart the session so that we get access
// to Selenium to clean up our configuration.
$this->start();
// Explicitly stop Selenium otherwise our session
// will not be freed for re-use.
$this->stop();
parent::tearDown();
}
示例3: tearDown
protected function tearDown()
{
parent::tearDown();
$this->deleteTmpDir('StandardFormLogin');
}
示例4: tearDown
/**
* @see PHPUnit_Framework_TestCase::tearDown()
*/
protected function tearDown()
{
// Restart the session so that we get access
// to Selenium to clean up our configuration.
$this->start();
// Reset to standard settings. We have to do this
// through the UI to correctly reset caches, too.
$this->resetDoiSettings();
// Explicitly stop Selenium otherwise our session
// will not be freed for re-use.
$this->stop();
parent::tearDown();
}
示例5: tearDown
/**
* tearDown implementation, setting back switched modules etc
*/
function tearDown()
{
if ($this->_modules != $this->_originalModules) {
$form_state['values'] = array('status' => $this->_originalModules, 'op' => t('Save configuration'));
drupal_execute('system_modules', $form_state);
//rebuilding all caches
drupal_rebuild_theme_registry();
node_types_rebuild();
menu_rebuild();
cache_clear_all('schema', 'cache');
module_rebuild_cache();
$this->_modules = $this->_originalModules;
}
foreach ($this->_cleanupVariables as $name => $value) {
if (is_null($value)) {
variable_del($name);
} else {
variable_set($name, $value);
}
}
$this->_cleanupVariables = array();
//delete nodes
foreach ($this->_cleanupNodes as $nid) {
node_delete($nid);
}
$this->_cleanupNodes = array();
//delete roles
while (sizeof($this->_cleanupRoles) > 0) {
$rid = array_pop($this->_cleanupRoles);
db_query("DELETE FROM {role} WHERE rid = %d", $rid);
db_query("DELETE FROM {permission} WHERE rid = %d", $rid);
}
//delete users and their content
while (sizeof($this->_cleanupUsers) > 0) {
$uid = array_pop($this->_cleanupUsers);
// cleanup nodes this user created
$result = db_query("SELECT nid FROM {node} WHERE uid = %d", $uid);
while ($node = db_fetch_array($result)) {
node_delete($node['nid']);
}
user_delete(array(), $uid);
}
//delete content types
foreach ($this->_cleanupContentTypes as $type) {
node_type_delete($type);
}
$this->_cleanupContentTypes = array();
//Output drupal warnings and messages into assert messages
$drupal_msgs = drupal_get_messages();
foreach ($drupal_msgs as $type => $msgs) {
foreach ($msgs as $msg) {
$this->assertTrue(TRUE, "{$type}: {$msg}");
}
}
parent::tearDown();
}
示例6: tearDown
/**
* Tears down the fixture.
*/
public function tearDown()
{
parent::tearDown();
}
示例7: tearDown
/**
* tearDown implementation, setting back switched modules etc
*/
function tearDown()
{
foreach ($this->_cleanupModules as $name => $status) {
db_query("UPDATE {system} SET status = %d WHERE name = '%s' AND type = 'module'", $status, $name);
}
$this->_cleanupModules = array();
// Refresh the modules list
module_list(TRUE, FALSE);
menu_rebuild();
foreach ($this->_cleanupVariables as $name => $value) {
if (is_null($value)) {
variable_del($name);
} else {
variable_set($name, $value);
}
}
$this->_cleanupVariables = array();
while (sizeof($this->_cleanupRoles) > 0) {
$rid = array_pop($this->_cleanupRoles);
db_query("DELETE FROM {role} WHERE rid = %d", $rid);
db_query("DELETE FROM {permission} WHERE rid = %d", $rid);
}
while (sizeof($this->_cleanupUsers) > 0) {
$uid = array_pop($this->_cleanupUsers);
// cleanup nodes this user created
$result = db_query("SELECT nid FROM {node} WHERE uid = %d", $uid);
while ($node = db_fetch_array($result)) {
node_delete($node['nid']);
}
user_delete(array(), $uid);
}
parent::tearDown();
}
示例8: tearDown
public function tearDown()
{
parent::tearDown();
set_include_path($this->old_include_path);
}