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


PHP SimpleTest类代码示例

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


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


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