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


PHP SimpleTest::prefer方法代码示例

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


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

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

示例2: TextReporter

<?php

require_once 'simpletest/autorun.php';
require_once 'simpletest/WMS_web_tester.php';
SimpleTest::prefer(new TextReporter());
require_once '../institution.cfg.php';
require_once '../lang.cfg.php';
class SetupTestData extends TestSuite
{
    function SetupTestData()
    {
        $this->TestSuite('Digital Field Notebooks test data creation');
        # Setup test data
        $this->addFile('TestOfSetupTestData.php');
    }
}
开发者ID:cwarren,项目名称:digitalfieldnotebooks,代码行数:16,代码来源:SetupTestData.php

示例3: paintException

require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../vendor/simpletest/simpletest/autorun.php';
$loader = new \Composer\Autoload\ClassLoader();
$loader->add('test', __DIR__ . '/..');
$loader->register();
class TraceReporter extends \TextReporter
{
    public function paintException($exception)
    {
        parent::paintException($exception);
        print $exception->getTraceAsString();
        print "\n";
    }
}
\SimpleTest::prefer(new TraceReporter());
class gihpPlumbingTests extends \TestSuite
{
    public function __construct()
    {
        parent::__construct('Gihp plumbing tests');
        $this->add(new plumbing\io());
        $this->add(new plumbing\blob());
        $this->add(new plumbing\tree());
        $this->add(new plumbing\commit());
        $this->add(new plumbing\annotatedtag());
        $this->add(new plumbing\head());
        $this->add(new plumbing\tag());
    }
}
class gihpPorcelainTests extends \TestSuite
开发者ID:vierbergenlars,项目名称:gihp,代码行数:30,代码来源:all.php

示例4: paintPass

{
    function paintPass($message)
    {
        parent::paintPass($message);
        print "&<span class=\"pass\">Pass</span>: ";
        $breadcrumb = $this->getTestList();
        array_shift($breadcrumb);
        print implode("->", $breadcrumb);
        print "->{$message}<br />\n";
    }
    protected function getCss()
    {
        return parent::getCss() . ' .pass { color: green; }';
    }
}
SimpleTest::prefer(new ShowPasses());
require_once 'simpletest/autorun.php';
require_once 'blackjack.php';
class TestDeck implements Deck
{
    private $deck = 0;
    public function __construct($cardarray)
    {
        $this->deck = $cardarray;
    }
    public function next()
    {
        return array_shift($this->deck);
    }
}
class TestBlackjackGame extends UnitTestCase
开发者ID:perenchiod,项目名称:php-blackjack,代码行数:31,代码来源:testblackjack.php

示例5: var_export

    {
        print "<pre>";
        var_export($var);
        print "</pre>";
    }
}
if (!function_exists('printDebug')) {
    function printDebug($text)
    {
        return;
    }
}
require_once PIWIK_INCLUDE_PATH . '/core/Loader.php';
require_once PIWIK_INCLUDE_PATH . '/libs/Zend/Exception.php';
require_once PIWIK_INCLUDE_PATH . '/core/ErrorHandler.php';
require_once PIWIK_INCLUDE_PATH . '/libs/Zend/Registry.php';
require_once PIWIK_INCLUDE_PATH . '/libs/Zend/Db.php';
require_once PIWIK_INCLUDE_PATH . '/libs/Zend/Db/Table.php';
require_once PIWIK_INCLUDE_PATH . '/core/FrontController.php';
require_once PIWIK_INCLUDE_PATH . '/core/Config.php';
require_once PIWIK_INCLUDE_PATH . '/core/Timer.php';
require_once PIWIK_INCLUDE_PATH . '/core/Access.php';
require_once PIWIK_INCLUDE_PATH . '/core/Log.php';
require_once PIWIK_INCLUDE_PATH . '/core/Piwik.php';
assert_options(ASSERT_ACTIVE, 1);
assert_options(ASSERT_WARNING, 1);
assert_options(ASSERT_BAIL, 0);
define('PIWIK_CONFIG_TEST_INCLUDED', true);
require_once 'HtmlTimerReporter.php';
SimpleTest::prefer(new HtmlTimerReporter());
开发者ID:nnnnathann,项目名称:piwik,代码行数:30,代码来源:config_test.php

示例6: define

<?php

if (!defined("PIWIK_PATH_TEST_TO_ROOT")) {
    define('PIWIK_PATH_TEST_TO_ROOT', '..');
}
if (!defined('PIWIK_INCLUDE_PATH')) {
    define('PIWIK_INCLUDE_PATH', PIWIK_PATH_TEST_TO_ROOT);
}
set_include_path(PIWIK_INCLUDE_PATH . '/core/' . PATH_SEPARATOR . PIWIK_INCLUDE_PATH . '/libs/' . PATH_SEPARATOR . PIWIK_INCLUDE_PATH . '/plugins/');
require_once 'Loader.php';
require_once 'simpletest/autorun.php';
require_once 'simpletest/mock_objects.php';
SimpleTest::prefer(new HtmlReporter());
error_reporting(E_ALL | E_NOTICE);
date_default_timezone_set('Europe/London');
require_once "Zend/Exception.php";
require_once "Zend/Loader.php";
require_once "ErrorHandler.php";
//set_error_handler('Piwik_ErrorHandler');
function dump($var)
{
    print "<pre>";
    var_export($var);
    print "</pre>";
}
require_once 'Zend/Registry.php';
require_once 'Zend/Config/Ini.php';
require_once 'Zend/Config.php';
require_once 'Zend/Db.php';
require_once 'Zend/Db/Table.php';
require_once 'FrontController.php';
开发者ID:klando,项目名称:pgpiwik,代码行数:31,代码来源:config_test.php

示例7: dirname

<?php

# Includes the usual includes, saves constant repition
require_once dirname(__FILE__) . '/simpletest/autorun.php';
require_once dirname(__FILE__) . '/pretty_passes_reporter.php';
require_once dirname(__FILE__) . '/extended_web_test_case.php';
require_once dirname(__FILE__) . '/solr.php';
require_once dirname(__FILE__) . '/helpers.php';
require_once dirname(__FILE__) . '/similarity_test_case.php';
SimpleTest::prefer(new PrettyPassesReporter());
开发者ID:robomc,项目名称:solr-tests,代码行数:10,代码来源:all.php

示例8: _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

示例9: paintHeader

/// A reporter that prints nothing unless a test fails
class QuietReporter extends TextReporter
{
    function paintHeader($test_name)
    {
        // Store the test name for use later if we output anything
        $this->test_name = $test_name;
    }
    function paintFooter($test_name)
    {
        if ($this->getFailCount() + $this->getExceptionCount() > 0) {
            print "{$test_name}: Failures:\n";
            print "Test cases run: " . $this->getTestCaseProgress() . "/" . $this->getTestCaseCount() . ", Passes: " . $this->getPassCount() . ", Failures: " . $this->getFailCount() . ", Exceptions: " . $this->getExceptionCount() . "\n";
        }
    }
    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";
        }
    }
}
// Use the quiet reporter if verbose output has not been requested
if (!getenv('UNITTEST_VERBOSE')) {
    SimpleTest::prefer(new QuietReporter());
}
开发者ID:bufvc,项目名称:bufvc-potnia-framework,代码行数:31,代码来源:unit_test.inc.php

示例10: error_reporting

<?php

error_reporting((E_ALL | E_NOTICE) & ~E_DEPRECATED);
define("PATH_ROOT", "/Volumes/Users/Entwicklung/php/workspace/koala-2_1/classes/");
define("PATH_UNITTEST", "/Volumes/Users/Entwicklung/php/workspace/koala-2_1/classes/PHPsTeam/unittest/");
/*require(PATH_ROOT . 'Autoloader.class.php');
Autoloader::setCacheFilePath(PATH_ROOT . '../temp/class_path_cache.txt');
Autoloader::excludeFolderNamesMatchingRegex('/^CVS|\..*$/');
Autoloader::setClassPaths(array(
    PATH_ROOT . "PHPsTeam/"
));
spl_autoload_register(array('Autoloader', 'loadClass'));*/
require PATH_ROOT . "autoloader/Autoloader.php";
Autoloader::getRegisteredAutoloader()->remove();
$autoloader = new Autoloader(PATH_ROOT);
$autoloader->register();
$autoloader->getIndex()->setIndexPath(PATH_ROOT . "../temp/phpsteam_unittest_autoloader.gz");
require_once 'classes/autorun.php';
//require_once PATH_UNITTEST . 'classes/simpletest.php';
//require_once PATH_UNITTEST . 'inc/showpasses.class.php';
SimpleTest::prefer(new showpasses());
class PHPsTeam_TestSuite extends TestSuite
{
    function PHPsTeam_TestSuite()
    {
        $this->TestSuite("all PHPsTeam unit tests");
        $this->addFile(PATH_UNITTEST . "steam_connector_test.class.php");
        $this->addFile(PATH_UNITTEST . "steam_factory_test.class.php");
        $this->addFile(PATH_UNITTEST . "steam_document_test.class.php");
    }
}
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:PHPsTeam_TestSuite.class.php

示例11: define_url_test

 * 
 * URL_TEST = http://127.0.0.1:8080/LOG210-LAB/;
 */
function define_url_test()
{
    $url_test = "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . dirname(URL);
    if (strcmp($url_test[strlen($url_test) - 1], '/')) {
        $url_test = $url_test . '/';
    }
    define('URL_TEST', $url_test);
}
require_once 'AfficherTest.php';
require_once 'simpletest/autorun.php';
require_once '../application/config/config.php';
require_once '../application/libs/controller.php';
SimpleTest::prefer(new AfficherTest());
define_url_test();
class AllTests extends TestSuite
{
    function AllTests()
    {
        $this->TestSuite('All tests');
        // Commence par test les models
        $this->addFile('test_models_user.php');
        $this->addFile('test_models_restaurant.php');
        // Test la création de comptes divers et de restaurants
        $this->addFile('test_user_creation.php');
        $this->addFile('test_restaurant_creation.php');
        // Test la gestion de comptes et restaurants
        $this->addFile('test_user_manage.php');
        $this->addFile('test_restaurant_manage.php');
开发者ID:JulioQc,项目名称:LOG210-LAB,代码行数:31,代码来源:index.php


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