本文整理汇总了PHP中SimpleTest::preferred方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleTest::preferred方法的具体用法?PHP SimpleTest::preferred怎么用?PHP SimpleTest::preferred使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleTest
的用法示例。
在下文中一共展示了SimpleTest::preferred方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DefaultReporter
/**
* Assembles the appopriate reporter for the environment.
*/
function DefaultReporter()
{
if (SimpleReporter::inCli()) {
global $argv;
$parser = new SimpleCommandLineParser($argv);
$interfaces = $parser->isXml() ? array('XmlReporter') : array('TextReporter');
$reporter =& new SelectiveReporter(SimpleTest::preferred($interfaces), $parser->getTestCase(), $parser->getTest());
} else {
$reporter =& new SelectiveReporter(SimpleTest::preferred('HtmlReporter'), @$_GET['c'], @$_GET['t']);
}
$this->SimpleReporterDecorator($reporter);
}
示例2: __construct
/**
* Assembles the appropriate reporter for the environment.
*/
function __construct()
{
if (SimpleReporter::inCli()) {
$parser = new SimpleCommandLineParser($_SERVER['argv']);
$interfaces = $parser->isXml() ? array('XmlReporter') : array('TextReporter');
if ($parser->help()) {
// I'm not sure if we should do the echo'ing here -- ezyang
echo $parser->getHelpText();
exit(1);
}
$reporter = new SelectiveReporter(SimpleTest::preferred($interfaces), $parser->getTestCase(), $parser->getTest());
if ($parser->noSkips()) {
$reporter = new NoSkipsReporter($reporter);
}
} else {
$reporter = new SelectiveReporter(SimpleTest::preferred('HtmlReporter'), @$_GET['c'], @$_GET['t']);
if (@$_GET['skips'] == 'no' || @$_GET['show-skips'] == 'no') {
$reporter = new NoSkipsReporter($reporter);
}
}
parent::__construct($reporter);
}
示例3: __construct
/**
* Assembles the appropriate reporter for the environment.
*/
public function __construct()
{
if (SimpleReporter::inCli()) {
$parser = new SimpleCommandLineParser($_SERVER['argv']);
$this->doCodeCoverage = $parser->doCodeCoverage();
$this->excludes = $parser->getExcludes();
if ($parser->isXml()) {
$interfaces = array('XmlReporter');
} else {
if ($parser->isJUnit()) {
$interfaces = array('JUnitXmlReporter');
} else {
$interfaces = array('TextReporter');
}
}
if ($parser->help()) {
echo $parser->getHelpText();
exit(1);
}
$reporter = new SelectiveReporter(SimpleTest::preferred($interfaces), $parser->getTestCase(), $parser->getTest());
if ($parser->noSkips()) {
$reporter = new NoSkipsReporter($reporter);
}
} else {
$reporter = new SelectiveReporter(SimpleTest::preferred('HtmlReporter'), @$_GET['c'], @$_GET['t']);
if (@$_GET['skips'] === 'no' || @$_GET['show-skips'] === 'no') {
$reporter = new NoSkipsReporter($reporter);
}
}
parent::__construct($reporter);
}
示例4: DefaultReporter
/**
* Assembles the appopriate reporter for the environment.
*/
function DefaultReporter()
{
//if (SimpleReporter::inCli()) {
if (in_array($_REQUEST["format"], array("xml", "text", "json"))) {
global $argv;
$parser = new SimpleCommandLineParser($argv);
switch ($_REQUEST["format"]) {
case "xml":
$interfaces = array('XmlReporter');
break;
case "text":
$interfaces = array('TextReporter');
break;
case "json":
$interfaces = array('JsonReporter');
break;
}
//$interfaces = $parser->isXml() ? array('XmlReporter') : array('TextReporter');
$reporter =& new SelectiveReporter(SimpleTest::preferred($interfaces), $parser->getTestCase(), $parser->getTest());
if ($parser->noSkips()) {
$reporter =& new NoSkipsReporter($reporter);
}
} else {
$reporter =& new SelectiveReporter(SimpleTest::preferred('HtmlReporter'), @$_GET['c'], @$_GET['t']);
if (@$_GET['skips'] == 'no' || @$_GET['show-skips'] == 'no') {
$reporter =& new NoSkipsReporter($reporter);
}
}
$this->SimpleReporterDecorator($reporter);
}
示例5: _getReporter
protected function _getReporter()
{
if (!$this->reporter) {
require_once dirname(__FILE__) . '/lmbTestShellReporter.class.php';
SimpleTest::prefer(new lmbTestShellReporter());
return clone SimpleTest::preferred(array('SimpleReporter', 'SimpleReporterDecorator'));
} else {
return clone $this->reporter;
}
}
示例6: __construct
/**
* Assembles the appopriate reporter for the environment.
*/
function __construct()
{
if (SimpleReporter::inCli()) {
global $argv;
$parser = new SimpleCommandLineParser($argv);
$interfaces = $parser->isXml() ? array('XmlReporter') : array('TextReporter');
$reporter =& new SelectiveReporter(SimpleTest::preferred($interfaces), $parser->getTestCase(), $parser->getTest());
if ($parser->noSkips()) {
$reporter =& new NoSkipsReporter($reporter);
}
} else {
$reporter =& new SelectiveReporter(SimpleTest::preferred('HtmlReporter'), @$_GET['c'], @$_GET['t']);
if (@$_GET['skips'] == 'no' || @$_GET['show-skips'] == 'no') {
$reporter =& new NoSkipsReporter($reporter);
}
}
parent::__construct($reporter);
}
示例7: __construct
/**
* Assembles the appropriate reporter for the environment.
*/
function __construct($arguments = null)
{
$in_cli = SimpleReporter::inCli();
if ($in_cli) {
$parser = new SimpleCommandLineParser(is_array($arguments) ? $arguments : $_SERVER['argv']);
} else {
$parser = new WebCommandLineParser(is_array($arguments) ? $arguments : array_merge(array(), isset($_GET) && is_array($_GET) ? $_GET : array(), isset($_POST) && is_array($_POST) ? $_POST : array()));
}
$interfaces = $parser->isXml() ? array('XmlReporter') : ($in_cli ? array('TextReporter') : array('HtmlReporter'));
$interfaces = $parser->isXml() ? array('XmlReporter') : ($in_cli ? array('TextReporter') : array('HtmlReporter'));
if ($parser->help()) {
// I'm not sure if we should do the echo'ing here -- ezyang
echo $parser->getHelpText();
exit(1);
}
// make sure we set the 'default server URI' for all tests now s it's a once-only write operation and we gotta be the first to win:
/* void */
$parser->getServerUrl();
$reporter = new SelectiveReporter(SimpleTest::preferred($interfaces), $parser->getTestCase(), $parser->getTest());
if ($parser->noSkips()) {
$reporter = new NoSkipsReporter($reporter);
}
if (!$parser->showPasses()) {
$reporter = new NoPassesReporter($reporter);
}
$reporter = new ListTestReporter($reporter);
parent::__construct($reporter);
$this->makeDry($parser->isDryRun());
$this->makeList($parser->isListRun());
$this->includeBreadCrumb($parser->showBreadCrumb());
$this->includeStackTrace($parser->showStackTrace());
}