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


PHP SimpleReporter类代码示例

本文整理汇总了PHP中SimpleReporter的典型用法代码示例。如果您正苦于以下问题:PHP SimpleReporter类的具体用法?PHP SimpleReporter怎么用?PHP SimpleReporter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SimpleReporter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     $test = new GroupTest("Piwik - running '{$this->testGroupType}' tests...");
     $intro = '';
     if (!$this->databaseRequired) {
         $intro .= $this->getTestDatabaseInfoMessage();
     }
     $intro .= self::$testsHelpLinks . "<hr/>";
     $intro .= $this->introAppend;
     $toInclude = array();
     foreach ($this->dirsToGlob as $dir) {
         $toInclude = array_merge($toInclude, Piwik::globr(PIWIK_INCLUDE_PATH . $dir, '*.test.php'));
     }
     // if present, make sure Database.test.php is first
     $idx = array_search(PIWIK_INCLUDE_PATH . '/tests/core/Database.test.php', $toInclude);
     if ($idx !== FALSE) {
         unset($toInclude[$idx]);
         array_unshift($toInclude, PIWIK_INCLUDE_PATH . '/tests/core/Database.test.php');
     }
     foreach ($toInclude as $file) {
         $test->addFile($file);
     }
     $result = $test->run(new HtmlTimerReporter($intro));
     if (SimpleReporter::inCli()) {
         exit($result ? 0 : 1);
     }
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:27,代码来源:TestRunner.php

示例2: simpletest_autorun

/**
 *    Exit handler to run all recent test cases and exit system if in CLI
 */
function simpletest_autorun()
{
    if (tests_have_run()) {
        return;
    }
    $result = run_local_tests();
    if (SimpleReporter::inCli()) {
        exit($result ? 0 : 1);
    }
}
开发者ID:sebs,项目名称:simpletest,代码行数:13,代码来源:autorun.php

示例3: simpletest_autorun

/**
 *    Exit handler to run all recent test cases and exit system if in CLI
 */
function simpletest_autorun() {
	chdir($GLOBALS['SIMPLETEST_AUTORUNNER_INITIAL_PATH']);
    if (tests_have_run()) {
        return;
    }
    $result = run_local_tests();
    if (SimpleReporter::inCli()) {
        exit($result ? 0 : 1);
    }
}
开发者ID:eltonsarmento,项目名称:CursosIAG,代码行数:13,代码来源:autorun.php

示例4: paintFail

 function paintFail($message)
 {
     SimpleReporter::paintFail($message);
     if ($this->getFailCount() <= 10) {
         print $this->test_name . ": {$message}\n";
         $breadcrumb = $this->getTestList();
         array_shift($breadcrumb);
         print "\tin " . implode("\n\tin ", array_reverse($breadcrumb));
         print "\n";
     }
 }
开发者ID:bufvc,项目名称:bufvc-potnia-framework,代码行数:11,代码来源:unit_test.inc.php

示例5: 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

示例6: run

 /**
  *    Invokes run() on all of the held test cases, instantiating
  *    them if necessary.
  *    @param SimpleReporter $reporter    Current test reporter.
  *    @param int $port Port to report test results on
  *    @access public
  */
 function run(&$reporter, $port)
 {
     $count = count($this->_test_cases);
     for ($i = 0; $i < $count; $i++) {
         if (is_string($this->_test_cases[$i])) {
             $class = $this->_test_cases[$i];
             $test =& new $class();
             ob_start();
             $reporter->paintGroupStart($this->getLabel(), $this->getSize());
             $reporter->paintCaseStart($test->getLabel());
             $start = ob_get_contents();
             ob_end_clean();
             ob_start();
             $reporter->paintCaseEnd($test->getLabel());
             $reporter->paintGroupEnd($this->getLabel());
             $end = ob_get_contents();
             ob_end_clean();
             //the guts from SimpleTestCase::run($reporter) where
             $test->_runner = new EclipseRunner($test, $reporter, $start, $end, $port);
             $test->_runner->run();
             $output = $start;
             if ($i + 1 == $count) {
                 $output .= "<done/>";
             }
             $output .= $end;
             $sock = new SimpleSocket("127.0.0.1", $port, 5);
             $sock->write($output);
             $sock->close();
             echo $sock->getError();
         } else {
             $this->_test_cases[$i]->run($reporter, $port);
         }
     }
     return $reporter->getStatus();
 }
开发者ID:sebs,项目名称:simpletest,代码行数:42,代码来源:eclipsetest.php

示例7: simpletest_autorun

/**
 *    Exit handler to run all recent test cases if no test has
 *    so far been run. Uses the DefaultReporter which can have
 *    it's output controlled with SimpleTest::prefer().
 */
function simpletest_autorun()
{
    if (tests_have_run()) {
        return;
    }
    $candidates = array_intersect(capture_new_classes(), classes_defined_in_initial_file());
    $loader = new SimpleFileLoader();
    $suite = $loader->createSuiteFromClasses(basename(initial_file()), $loader->selectRunnableTests($candidates));
    $result = $suite->run(new DefaultReporter());
    if (SimpleReporter::inCli()) {
        exit($result ? 0 : 1);
    }
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:18,代码来源:autorun.php

示例8: simpletest_autorun

/**
 *    Exit handler to run all recent test cases if no test has
 *    so far been run. Uses the DefaultReporter which can have
 *    it's output controlled with SimpleTest::prefer().
 */
function simpletest_autorun()
{
    try {
        if (tests_have_run()) {
            return;
        }
        $candidates = array_intersect(capture_new_classes(), classes_defined_in_initial_file());
        $loader = new SimpleFileLoader();
        $suite = $loader->createSuiteFromClasses(basename(initial_file()), $loader->selectRunnableTests($candidates));
        $result = $suite->run(new DefaultReporter());
    } catch (Exception $e) {
        // This is here, because under normal circumstances shutdown
        // functions don't have a stack frame, leading to obscure errors.
        echo $e->__toString();
        $result = false;
    }
    if (SimpleReporter::inCli()) {
        exit($result ? 0 : 1);
    }
}
开发者ID:googlecode-mirror,项目名称:bulldoc,代码行数:25,代码来源:autorun.php

示例9: __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

示例10: UnitTests

{
    function UnitTests()
    {
        $this->GroupTest("Unit tests");
        $this->addTestFile("errors_test.php");
        $this->addTestFile("options_test.php");
        $this->addTestFile("dumper_test.php");
        $this->addTestFile("expectation_test.php");
        $this->addTestFile("simple_mock_test.php");
        $this->addTestFile("adapter_test.php");
        $this->addTestFile("socket_test.php");
        $this->addTestFile("query_string_test.php");
        $this->addTestFile("http_test.php");
        $this->addTestFile("user_agent_test.php");
        $this->addTestFile("browser_test.php");
        $this->addTestFile("parser_test.php");
        $this->addTestFile("tag_test.php");
        $this->addTestFile("page_test.php");
        $this->addTestFile("frames_test.php");
        $this->addTestFile("shell_tester_test.php");
        $this->addTestFile("xml_test.php");
    }
}
if (!defined("TEST_RUNNING")) {
    define("TEST_RUNNING", true);
    $test =& new UnitTests();
    if (SimpleReporter::inCli()) {
        exit($test->run(new TextReporter()) ? 0 : 1);
    }
    $test->run(new HtmlReporter());
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:31,代码来源:unit_tests.php

示例11: paintSignal

 /**
  * Handle failinfo message
  */
 function paintSignal($type, $message)
 {
     parent::paintSignal($type, $message);
     if ($type = 'failinfo') {
         $this->_failinfo = $message;
     }
 }
开发者ID:pyfun,项目名称:dokuwiki,代码行数:10,代码来源:cli_reporter.php

示例12: paintError

 function paintError($message)
 {
     parent::paintError($message);
     $this->_response->addContent("Error !!\n");
     $breadcrumb = $this->getTestList();
     array_shift($breadcrumb);
     $this->_response->addContent("\tin " . implode("\n\tin ", array_reverse($breadcrumb)));
     $this->_response->addContent("\n\t " . $message . "\n");
 }
开发者ID:CREASIG,项目名称:lizmap-web-client,代码行数:9,代码来源:jtextrespreporter.class.php

示例13: paintSkip

 function paintSkip($message)
 {
     parent::paintSkip($message);
     $str = "<span class=\"pass\">Skipped</span>: ";
     $breadcrumb = $this->getTestList();
     array_shift($breadcrumb);
     $str .= implode(" -&gt; ", $breadcrumb);
     $str .= " -&gt; " . $this->_htmlEntities($message) . "<br />\n";
     $this->_response->body->append('MAIN', $str);
 }
开发者ID:jelix,项目名称:simpletest-module,代码行数:10,代码来源:jhtmlrespreporter.class.php

示例14: paintError

 function paintError($message)
 {
     parent::paintError($message);
     $str = "<span class=\"fail\">Exception</span>: ";
     $breadcrumb = $this->getTestList();
     array_shift($breadcrumb);
     $str .= implode(" -&gt; ", $breadcrumb);
     $str .= " -&gt; <strong>" . $this->_htmlEntities($message) . "</strong><br />\n";
     $this->_response->body->append('MAIN', $str);
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:10,代码来源:jhtmlrespreporter.class.php

示例15: paintFail

 function paintFail($message)
 {
     parent::paintFail($message);
     $breadcrumb = $this->getTestList();
     array_shift($breadcrumb);
     $test = implode("->", $breadcrumb);
     $result["time"] = time();
     $result["status"] = "Failed";
     $result["test"] = $test;
     $result["message"] = $message;
     $this->results[] = $result;
 }
开发者ID:sebs,项目名称:simpletest,代码行数:12,代码来源:recorder.php


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