当前位置: 首页>>代码示例>>PHP>>正文


PHP SimpleTest::preferred方法代码示例

本文整理汇总了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);
 }
开发者ID:nsystem1,项目名称:ZeeJong,代码行数:15,代码来源:default_reporter.php

示例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);
 }
开发者ID:JamesLinus,项目名称:platform,代码行数:25,代码来源:default_reporter.php

示例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);
 }
开发者ID:simpletest,项目名称:simpletest,代码行数:34,代码来源:default_reporter.php

示例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);
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:33,代码来源:default_reporter.php

示例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;
     }
 }
开发者ID:vasiatka,项目名称:sitemap,代码行数:10,代码来源:lmbTestRunner.class.php

示例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);
 }
开发者ID:triasfahrudin,项目名称:siska21,代码行数:21,代码来源:default_reporter.php

示例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());
 }
开发者ID:GerHobbelt,项目名称:simpletest,代码行数:35,代码来源:default_reporter.php


注:本文中的SimpleTest::preferred方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。