本文整理汇总了PHP中unset_global函数的典型用法代码示例。如果您正苦于以下问题:PHP unset_global函数的具体用法?PHP unset_global怎么用?PHP unset_global使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unset_global函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: scan_directory
function scan_directory()
{
global $suite, $total_tests, $total_failures, $testRunner;
$d = opendir(".");
while ($entry = readdir($d)) {
if ($entry == "." || $entry == "..") {
/** ignore these directories **/
} else {
if (is_dir($entry)) {
chdir($entry);
scan_directory();
chdir("..");
} else {
if (preg_match("/^[T|t]est/", $entry) && (preg_match("/[.]php3?\$/", $entry) || preg_match("/[.]inc\$/", $entry))) {
if (!defined("OPT_BE_BRIEF")) {
print "Requiring file ... {$entry}<br>\n";
}
require_once $entry;
// because we run into memory problems if we include
// all files and then run the tests, we run the test suite
// after each include.
$result = $testRunner->run($suite);
mkdb_check_did_db_fail_calls();
$total_tests += $result->countTests();
$total_failures += $result->countFailures();
unset_global('queries');
$result = '';
$suite = new TestSuite();
}
}
}
}
closedir($d);
}
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:34,代码来源:RunAllTests.php
示例2: tearDown
function tearDown()
{
unset_global('bx', 'db');
}
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:4,代码来源:TestRefereeslib.php
示例3: setup
function setup()
{
unset_global('bx', 'db');
}
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:4,代码来源:TestBrowselib.php
示例4: testConfigure_form
function testConfigure_form()
{
global $bx, $t, $sess, $preview, $quorum, $other_tech_contents, $other_developing_proposals, $consultants, $auth, $queries;
$uname = 'this is the usernmae';
$auth->set_uname($uname);
$preview = 'this is the preview';
$quorum = 'this is the qurom';
$other_tech_contents = 'this is the other tech contents';
$other_developing_proposals = 'this is the other developing proposals';
$consultants = 'this is the consulants';
$db_config = new mock_db_configure(178);
$args = $this->_generate_records(array('proid'), 50);
$fname = 'configure_form';
$qs = array(0 => $queries[$fname]);
// test1: configure_first_time(..) returns 1 (true)
$db_config->add_query(sprintf($qs[0], $args[0]['proid']), 0);
$db_config->add_num_row(0, 0);
// test2: configure_first_time(..) returns 0 (false)
$db_config->add_query(sprintf($qs[0], $args[1]['proid']), 1);
$db_config->add_num_row(1, 1);
// test one, all queries to is_sponsor and is_project_initiator and
// is_developer return false because the perm attribute of auth
// is empty.
$auth->set_perm('');
unset_global('preview');
$bx = $this->_create_default_box();
$this->capture_call($fname, 1478 + strlen($sess->self_url()), $args[0]);
$this->_configure_form_checkfor_form_and_box($args[0]);
// test two: the same as above, except configure_first_time(..) returns
// false and therefore it is necessary to set preview
$auth->set_perm('');
$GLOBALS['preview'] = 'is set and not empty ...';
$bx = $this->_create_default_box();
$this->capture_call($fname, 1478 + strlen($sess->self_url()), $args[1]);
$this->_configure_form_checkfor_form_and_box($args[1]);
// switch authorisation for the tests to follow
$auth->set_perm('hell yes!');
// now do an exhaustive test, i.e. test all possible combination
// of query return values
$qmask = array(0 => 0);
$cfmask = array();
$sinst = 2;
for ($idx = 0, $jdx = 2; $idx < 32; $idx++, $jdx++) {
$cfmask[0] = $qmask[1] = ($idx & 0x1) > 0;
$cfmask[1] = $qmask[2] = ($idx & 0x2) > 0;
$cfmask[2] = $qmask[3] = ($idx & 0x4) > 0;
$qmask[4] = ($idx & 0x8) > 0;
$qmask[5] = ($idx & 0x10) > 0;
$cfmask[3] = $qmask[4] && $qmask[5];
$this->set_msg('Test ' . $jdx . " 0=>" . $qmask[1] . " 1=>" . $qmask[2] . " 2=>" . $qmask[3] . " 3=>" . $qmask[4] . " 4=>" . $qmask[5]);
$len = 1478 + ($cfmask[0] ? 724 : 0) + ($cfmask[1] ? 458 : 0) + ($cfmask[2] ? 535 : 0) + ($cfmask[3] ? 438 : 0);
// FIXME: why do we add one more to the length if the second
// FIXME: call to is_sponsor _or_ the second call to is_project_
// FIXME: initiator returns true *but* not when both are true!!!
if ($qmask[4] && !$qmask[5] || !$qmask[4] && $qmask[5]) {
$len++;
}
$sinst = $this->_configure_form_config_db($sinst, $db_config, $args[$jdx], $qs, $uname, $qmask);
$bx = $this->_create_default_box();
$this->capture_call($fname, $len + strlen($sess->self_url()), $args[$jdx]);
$this->_configure_form_checkfor_form_and_box($args[$jdx]);
$this->_configure_form_checkfor_parts($cfmask);
}
$this->_check_db($db_config);
}
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:65,代码来源:TestConfigurelib.php
示例5: unset_error_values
function unset_error_values()
{
unset_global('err_no', 'err_msg', 'err_line', 'err_file');
}
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:4,代码来源:constants.php
注:本文中的unset_global函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论