當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。