本文整理汇总了PHP中epIsWebRun函数的典型用法代码示例。如果您正苦于以下问题:PHP epIsWebRun函数的具体用法?PHP epIsWebRun怎么用?PHP epIsWebRun使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了epIsWebRun函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: epVarDump
/**
* Wrapper of Var_Dump
* @param mixed any kind of eepression
* @return void
*/
function epVarDump($var)
{
static $vd;
if (epIsWebRun()) {
include_once 'Var_Dump.php';
Var_Dump::displayInit(array('display_mode' => 'HTML4_Table'));
Var_Dump::display($var);
} else {
var_dump($var);
}
}
示例2: catch
// getting protected 'z' gets exception
try {
$this->assertTrue($w['z'] === false);
} catch (Exception $e) {
// !!!simpletest seem to ignore assert in catch block
$this->assertTrue($e instanceof epExceptionObject);
}
// setting protected 'z' gets exception
try {
$w['z'] = 'ZZZ|ZZZ';
} catch (Exception $e) {
// !!!simpletest seem to ignore assert in catch block
$this->assertTrue($e instanceof epExceptionObject);
}
// test foreach
$vars = array();
foreach ($w as $var => $value) {
$vars[$var] = $value;
}
// check var number
$this->assertTrue(count($vars) == $w->count());
}
}
if (!defined('EP_GROUP_TEST')) {
$t = new epTestObject();
if (epIsWebRun()) {
$t->run(new HtmlReporter());
} else {
$t->run(new TextReporter());
}
}