• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SimpleTest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: warmup

 /**
  * Runs an empty test to determine the benchmark overhead and run each test once
  */
 private function warmup()
 {
     $warmup = new SimpleTest('warmup', function () {
     });
     $warmup->run();
     foreach ($this->tests as $test) {
         $test->run();
     }
     $this->base_results = $warmup->run($this->n);
 }
开发者ID:lavoiesl,项目名称:php-benchmark,代码行数:13,代码来源:Benchmark.php


示例2: tests_have_run

/**
 *    Checks the current test context to see if a test has
 *    ever been run.
 *    @return boolean        True if tests have run.
 */
function tests_have_run()
{
    if ($context = SimpleTest::getContext()) {
        return (bool) $context->getTest();
    }
    return false;
}
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:12,代码来源:autorun.php


示例3: run

 function run($reporter)
 {
     $context = SimpleTest::getContext();
     $context->setTest($this);
     $context->setReporter($reporter);
     $this->reporter = $reporter;
     $this->reporter->paintCaseStart($this->getLabel());
     if ($this->needPDO) {
         $this->reporter->makeDry(!$this->assertTrue(class_exists('PDO', false), 'PDO does not exists ! You should install PDO because tests need it.'));
     }
     $this->setUpRun();
     foreach ($this->getTests() as $method) {
         if ($this->reporter->shouldInvoke($this->getLabel(), $method)) {
             $this->skip();
             if ($this->shouldSkip()) {
                 break;
             }
             $invoker = $this->reporter->createInvoker($this->createInvoker());
             $invoker->before($method);
             $invoker->invoke($method);
             $invoker->after($method);
         }
     }
     $this->tearDownRun();
     $this->reporter->paintCaseEnd($this->getLabel());
     unset($this->reporter);
     return $reporter->getStatus();
 }
开发者ID:CREASIG,项目名称:lizmap-web-client,代码行数:28,代码来源:junittestcase.class.php


示例4: AllTests

 function AllTests()
 {
     $this->TestSuite('FlatDB tests - Simple test' . SimpleTest::getVersion());
     $this->addFile(dirname(__FILE__) . '/test_rows.php');
     $this->addFile(dirname(__FILE__) . '/test_columns.php');
     $this->addFile(dirname(__FILE__) . '/test_read_add.php');
 }
开发者ID:rotvalli,项目名称:FlatDB,代码行数:7,代码来源:all_tests.php


示例5: setPreference

 public static function setPreference()
 {
     if (TextReporter::inCli()) {
         SimpleTest::prefer(new Xml_Chris());
     } else {
         SimpleTest::prefer(new Html_Chris());
     }
 }
开发者ID:masroore,项目名称:chrisreloaded,代码行数:8,代码来源:simpletest_chris.php


示例6: shouldInvoke

 /**
  * @param string $testCase
  * @param string $method
  * @return boolean
  */
 public function shouldInvoke($testCase, $method)
 {
     $test = SimpleTest::getContext()->getTest();
     if ($test instanceof CakeTestCase && in_array(strtolower($method), $test->methods)) {
         return true;
     }
     return parent::shouldInvoke($testCase, $method);
 }
开发者ID:nojimage,项目名称:stagehand-testrunner,代码行数:13,代码来源:MethodFilterReporter.php


示例7: AllTests

 function AllTests()
 {
     $this->GroupTest('All tests for SimpleTest ' . SimpleTest::getVersion());
     $this->addTestCase(new UnitTests());
     $this->addTestFile(dirname(__FILE__) . '/shell_test.php');
     $this->addTestFile(dirname(__FILE__) . '/live_test.php');
     $this->addTestFile(dirname(__FILE__) . '/acceptance_test.php');
 }
开发者ID:TomMaher,项目名称:umambo,代码行数:8,代码来源:test_groups.php


示例8:

 /**
  *    Wires up the error queue for a single test.
  *
  *    @return SimpleErrorQueue    Queue connected to the test.
  */
 public function &_createErrorQueue()
 {
     $context =& SimpleTest::getContext();
     $test =& $this->getTestCase();
     $queue =& $context->get('SimpleErrorQueue');
     $queue->setTestCase($test);
     return $queue;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:13,代码来源:errors.php


示例9: createErrorQueue

 /**
  *    Wires up the error queue for a single test.
  *    @return SimpleErrorQueue    Queue connected to the test.
  *    @access private
  */
 protected function createErrorQueue()
 {
     $context = SimpleTest::getContext();
     $test = $this->getTestCase();
     $queue = $context->get('SimpleErrorQueue');
     $queue->setTestCase($test);
     return $queue;
 }
开发者ID:JamesLinus,项目名称:platform,代码行数:13,代码来源:errors.php


示例10: __construct

 function __construct()
 {
     parent::__construct('All tests for SimpleTest ' . SimpleTest::getVersion());
     $this->addFile(dirname(__FILE__) . '/unit_tests.php');
     $this->addFile(dirname(__FILE__) . '/shell_test.php');
     $this->addFile(dirname(__FILE__) . '/live_test.php');
     $this->addFile(dirname(__FILE__) . '/acceptance_test.php');
 }
开发者ID:triasfahrudin,项目名称:siska21,代码行数:8,代码来源:all_tests.php


示例11:

 function &_getRegistry()
 {
     static $registry = false;
     if (!$registry) {
         $registry = SimpleTest::_getDefaults();
     }
     return $registry;
 }
开发者ID:BackupTheBerlios,项目名称:phpbase-svn,代码行数:8,代码来源:simpletest.php


示例12: shouldPaintMethod

 /**
  * @param string $testName
  */
 protected function shouldPaintMethod($testName)
 {
     $testCase = SimpleTest::getContext()->getTest();
     if (!$testCase instanceof CakeTestCase) {
         return true;
     }
     return !in_array(strtolower($testName), $testCase->methods);
 }
开发者ID:rsky,项目名称:makegood,代码行数:11,代码来源:JUnitXMLReporter.php


示例13: AllTests

 public function AllTests()
 {
     $this->TestSuite('All tests for SimpleTest ' . SimpleTest::getVersion());
     $this->addFile(dirname(__FILE__) . '/unit_tests.php');
     $this->addFile(dirname(__FILE__) . '/shell_test.php');
     $this->addFile(dirname(__FILE__) . '/live_test.php');
     $this->addFile(dirname(__FILE__) . '/acceptance_test.php');
 }
开发者ID:Clansuite,项目名称:Clansuite,代码行数:8,代码来源:all_tests.php


示例14: __construct

 /**
  *    Starts with a fresh browser with no
  *    cookie or any other state information. The
  *    exception is that a default proxy will be
  *    set up if specified in the options.
  *    @access public
  */
 function __construct()
 {
     $this->user_agent = $this->createUserAgent();
     $this->user_agent->useProxy(SimpleTest::getDefaultProxy(), SimpleTest::getDefaultProxyUsername(), SimpleTest::getDefaultProxyPassword());
     $this->page = new SimplePage();
     $this->history = $this->createHistory();
     $this->ignore_frames = false;
     $this->maximum_nested_frames = DEFAULT_MAX_NESTED_FRAMES;
 }
开发者ID:ilune,项目名称:simpletest,代码行数:16,代码来源:light_browser.php


示例15: ExtensionsTests

 public function ExtensionsTests()
 {
     $this->TestSuite('Extension tests for SimpleTest ' . SimpleTest::getVersion());
     $nodes = new RecursiveDirectoryIterator(dirname(__FILE__) . '/../extensions/');
     foreach (new RecursiveIteratorIterator($nodes) as $node) {
         if (preg_match('/test\\.php$/', $node->getFilename())) {
             $this->addFile($node->getPathname());
         }
     }
 }
开发者ID:Clansuite,项目名称:Clansuite,代码行数:10,代码来源:extensions_tests.php


示例16: __construct

 public function __construct()
 {
     parent::__construct('All tests for SimpleTest ' . SimpleTest::getVersion());
     $this->addFile(dirname(__FILE__) . '/unit_tests.php');
     $this->addFile(dirname(__FILE__) . '/shell_test.php');
     $this->addFile(dirname(__FILE__) . '/live_test.php');
     // jakoch: disabled acceptance tests.
     // because, we will not test against a live server over the network.
     //$this->addFile(dirname(__FILE__) . '/acceptance_test.php');
 }
开发者ID:VasuLief,项目名称:simpletest,代码行数:10,代码来源:all_tests.php


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


示例18: __construct

 public function __construct()
 {
     parent::__construct('All tests for SimpleTest ' . SimpleTest::getVersion());
     $this->addFile(dirname(__FILE__) . '/unit_tests.php');
     $this->addFile(dirname(__FILE__) . '/shell_test.php');
     $this->addFile(dirname(__FILE__) . '/live_test.php');
     // The acceptance tests "examples" are served via PHP's built-in webserver,
     // which is available from PHP5.4 on.
     if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
         $this->addFile(dirname(__FILE__) . '/acceptance_test.php');
     }
 }
开发者ID:guicara,项目名称:simpletest,代码行数:12,代码来源:all_tests.php


示例19: __construct

 function __construct()
 {
     /*
     And a little hack to make sure PHP does not timeout
     */
     //   http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time
     set_time_limit(max(5 * 60, ini_get('max_execution_time')));
     parent::__construct('All tests for SimpleTest ' . SimpleTest::getVersion());
     $this->addFile(dirname(__FILE__) . '/unit_tests.php');
     $this->addFile(dirname(__FILE__) . '/shell_test.php');
     $this->addFile(dirname(__FILE__) . '/live_test.php');
     $this->addFile(dirname(__FILE__) . '/acceptance_test.php');
 }
开发者ID:GerHobbelt,项目名称:simpletest,代码行数:13,代码来源:all_tests.php


示例20: AllTests

 function AllTests()
 {
     $this->TestSuite('All tests for evalcomix_tool ' . SimpleTest::getVersion());
     $this->addFile(dirname(__FILE__) . '/testevalcomix_tool.php');
     $this->addFile(dirname(__FILE__) . '/testevalcomix.php');
     $this->addFile(dirname(__FILE__) . '/testevalcomix_assessments.php');
     $this->addFile(dirname(__FILE__) . '/testevalcomix_modes.php');
     $this->addFile(dirname(__FILE__) . '/testevalcomix_modes_extra.php');
     $this->addFile(dirname(__FILE__) . '/testevalcomix_modes_time.php');
     $this->addFile(dirname(__FILE__) . '/testevalcomix_tasks.php');
     //$this->addFile(dirname(__FILE__) . '/testwebservice_evalcomix_client.php');
     $this->addFile(dirname(__FILE__) . '/testcalculator_average.php');
 }
开发者ID:srpaedagogus,项目名称:aulavirtual,代码行数:13,代码来源:all_tests.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SimpleTestCase类代码示例发布时间:2022-05-23
下一篇:
PHP SimpleTag类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap