本文整理汇总了PHP中TextReporter类的典型用法代码示例。如果您正苦于以下问题:PHP TextReporter类的具体用法?PHP TextReporter怎么用?PHP TextReporter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TextReporter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: report
/**
* Genereates a nice report of the test.
*
* It instantiate a SimpleTest TestSuite and launches a Reporter.
* This method is typically called by a TestRunner.
*
* @return void
* @see KortTestRunner
* @see KortCliReporter
* @see KortHTMLReporter
*/
public function report()
{
$test = new \TestSuite($this->getLabel());
$test->add($this);
if (\TextReporter::inCli()) {
exit($test->run(new KortCliReporter()) ? 0 : 1);
}
$test->run(new KortHTMLReporter());
}
开发者ID:CloCkWeRX,项目名称:kort,代码行数:20,代码来源:AbstractKortUnitTestCase.php
示例3: paintFooter
/**
* Capture the attempt to display the final test results and insert the
* ANSI-color codes in place.
*
* @param string
* @see TextReporter
* @access public
*/
function paintFooter($test_name)
{
ob_start();
parent::paintFooter($test_name);
$output = trim(ob_get_clean());
if ($output) {
if ($this->getFailCount() + $this->getExceptionCount() == 0) {
$color = $this->_passColor;
} else {
$color = $this->_failColor;
}
$this->_setColor($color);
echo $output;
$this->_resetColor();
}
}
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:24,代码来源:colortext_reporter.php
示例4: dirname
<?php
require_once 'simpletest/unit_tester.php';
require_once 'simpletest/reporter.php';
require_once dirname(__FILE__) . '/addendum_test.php';
require_once dirname(__FILE__) . '/acceptance_test.php';
require_once dirname(__FILE__) . '/annotation_test.php';
require_once dirname(__FILE__) . '/constrained_annotation_test.php';
require_once dirname(__FILE__) . '/annotation_parser_test.php';
require_once dirname(__FILE__) . '/doc_comment_test.php';
$suite = new TestSuite('All tests');
$suite->add(new TestOfAddendum());
$suite->add(new TestOfAnnotations());
$suite->add(new TestOfPerformanceFeatures());
$suite->add(new TestOfSupportingFeatures());
$suite->add(new TestOfAnnotation());
$suite->add(new TestOfAnnotationCollection());
$suite->add(new TestOfConstrainedAnnotation());
$suite->add(new TestOfMatchers());
$suite->add(new TestOfAnnotationMatchers());
$suite->add(new TestOfDocComment());
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
require_once dirname(__FILE__) . '/namespaces_test.php';
$suite->add(new TestOfNamespaces());
}
$reporter = TextReporter::inCli() ? new TextReporter() : new HtmlReporter();
Addendum::setRawMode(false);
$suite->run($reporter);
Addendum::setRawMode(true);
$suite->run($reporter);
开发者ID:Guepardo,项目名称:PHPAnnotations,代码行数:30,代码来源:all_tests.php
示例5: run_tests
public function run_tests($argv)
{
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
define("ENV", "test");
$this->app_setup();
define("CLI_ENV", true);
if (!(include 'simpletest/unit_tester.php') || !(include 'simpletest/mock_objects.php')) {
throw new WXDependencyException("Simpletest library required. Install it somewhere in the include path", "Simpletest Dependency Failure");
}
if ($argv[1] == "wax") {
$testdir = FRAMEWORK_DIR . "/tests";
} elseif ($argv[1] && is_dir(PLUGIN_DIR . $argv[1] . "/tests")) {
$testdir = PLUGIN_DIR . $argv[1] . "/tests";
} else {
$testdir = APP_DIR . "tests";
}
AutoLoader::include_dir($testdir);
$test = new GroupTest('All tests');
foreach (scandir($testdir) as $file) {
if (substr($file, -3) == "php" && substr($file, 0, 1) != ".") {
$class = substr($file, 0, -4);
$test->addTestClass($class);
}
}
if (TextReporter::inCli()) {
exit($test->run(new TextReporter()) ? 0 : 1);
}
$test->run(new HtmlReporter());
}
开发者ID:phpwax,项目名称:phpwax,代码行数:29,代码来源:WXScripts.php
示例6: ak_test
function ak_test($test_case_name, $use_sessions = false, $prevent_double_test_running = true, $custom_reporter = false)
{
static $ran_tests = array();
if (!isset($ran_tests[$test_case_name]) || !$prevent_double_test_running) {
if (!defined('ALL_TESTS_CALL')) {
$use_sessions ? @session_start() : null;
$test = new $test_case_name();
if (empty($custom_reporter)) {
if (defined('AK_CLI') && AK_CLI || TextReporter::inCli() || defined('AK_CONSOLE_MODE') && AK_CONSOLE_MODE || defined('AK_WEB_REQUEST') && !AK_WEB_REQUEST) {
$test->run(new TextReporter());
} else {
$test->run(new HtmlReporter());
}
} else {
$test->run(new $custom_reporter());
}
}
$ran_tests[$test_case_name] = true;
}
}
开发者ID:bermi,项目名称:sintags,代码行数:20,代码来源:base.php
示例7: ak_test
function ak_test($test_case_name, $use_sessions = false)
{
if (!defined('ALL_TESTS_CALL')) {
$use_sessions ? @session_start() : null;
$test =& new $test_case_name();
if (defined('AK_CLI') && AK_CLI || TextReporter::inCli() || defined('AK_CONSOLE_MODE') && AK_CONSOLE_MODE || defined('AK_WEB_REQUEST') && !AK_WEB_REQUEST) {
$test->run(new TextReporter());
} else {
$test->run(new HtmlReporter());
}
}
}
开发者ID:joeymetal,项目名称:v1,代码行数:12,代码来源:constants.php
示例8: defined
<?php
defined('ALL_TESTS_CALL') ? null : define("ALL_TESTS_CALL", true);
defined('AK_ENABLE_PROFILER') ? null : define('AK_ENABLE_PROFILER', true);
defined('AK_TEST_DATABASE_ON') ? null : define('AK_TEST_DATABASE_ON', true);
require_once dirname(__FILE__) . '/../../fixtures/config/config.php';
if (!defined('ALL_TESTS_RUNNER') && empty($test)) {
$test = new GroupTest('Akelos Framework Active Record Tests');
define('ALL_TESTS_RUNNER', false);
@session_start();
}
//these partials are not refactored yet. so they must be run in sequence!
$partial_tests = array('_AkActiveRecord_1.php', '_AkActiveRecord_2.php', '_AkActiveRecord_3.php');
foreach ($partial_tests as $partial_test) {
$test->addTestFile(AK_LIB_TESTS_DIRECTORY . DS . 'AkActiveRecord' . DS . $partial_test);
}
foreach (Ak::dir(AK_LIB_TESTS_DIRECTORY . DS . 'AkActiveRecord') as $active_record_test) {
if (!is_array($active_record_test) && !in_array($active_record_test, $partial_tests)) {
if (!ALL_TESTS_RUNNER || $active_record_test[0] == '_') {
$test->addTestFile(AK_LIB_TESTS_DIRECTORY . DS . 'AkActiveRecord' . DS . $active_record_test);
}
}
}
if (!ALL_TESTS_RUNNER) {
if (TextReporter::inCli()) {
exit($test->run(new TextReporter()) ? 0 : 1);
}
$test->run(new HtmlReporter());
}
开发者ID:joeymetal,项目名称:v1,代码行数:29,代码来源:AkActiveRecord.php
示例9: paintFooter
/**
* Paints the end of the test with a summary of
* the passes and failures.
*
* @param string $test_name Name class of test.
* @access public
*/
function paintFooter($test_name)
{
parent::paintFooter($test_name);
echo 'Time taken by tests (in seconds): ' . $this->_timeDuration . "\n";
if (function_exists('memory_get_peak_usage')) {
echo 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . "\n";
}
}
开发者ID:evrard,项目名称:cakephp2x,代码行数:15,代码来源:cake_text_reporter.php
示例10: paintPass
function paintPass($message)
{
parent::paintPass($message);
if ($this->verbose) {
print 'Pass ' . $this->getPassCount() . ") {$message}\n";
$breadcrumb = $this->getTestList();
array_shift($breadcrumb);
print "\tin " . implode("\n\tin ", array_reverse($breadcrumb));
print "\n";
}
}
开发者ID:artbypravesh,项目名称:morningpages,代码行数:11,代码来源:TextReporter.php
示例11: paintPass
function paintPass($message)
{
parent::paintPass($message);
$breadcrumb = $this->getTestList();
array_shift($breadcrumb);
if ($this->lastfile != $breadcrumb[0]) {
print "{$breadcrumb['0']}\n";
$this->lastfile = $breadcrumb[0];
}
array_shift($breadcrumb);
print "\t" . implode(":", $breadcrumb) . ": OK\n";
//print ": $message\n";
}
开发者ID:haakonnessjoen,项目名称:SimpleActiveRecord,代码行数:13,代码来源:all_tests.php
示例12: paintException
function paintException($exception)
{
parent::paintException($exception);
print "Exception full message:\n";
print $exception->__toString();
$this->failed_tests[] = '[EXP] ' . $this->_extractExceptionFileAndLine($exception);
}
开发者ID:knevcher,项目名称:limb,代码行数:7,代码来源:lmbTestShellReporter.class.php
示例13: paintCaseEnd
function paintCaseEnd($test_name)
{
parent :: paintCaseEnd($test_name);
print $this->getTestCaseProgress() . " of " . $this->getTestCaseCount() . " done({$test_name})\n";
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:6,代码来源:limb_cli_reporter.class.php
示例14: chr
function __construct()
{
parent::__construct();
$this->esc_start = chr(27) . '[';
}
开发者ID:muhamadsyahril,项目名称:codeigniter-simpletest,代码行数:5,代码来源:cli_reporter.php
示例15: paintMethodStart
/**
* Display the start of each method
*
* @param string $test_name
*/
function paintMethodStart($test_name)
{
parent::paintMethodStart($test_name);
print "Method: {$test_name}\n";
}
开发者ID:5haman,项目名称:knowledgetree,代码行数:10,代码来源:test.php
示例16: paintException
public function paintException($exception)
{
parent::paintException($exception);
print $exception->getTraceAsString();
print "\n";
}
开发者ID:vierbergenlars,项目名称:gihp,代码行数:6,代码来源:all.php
示例17: getCss
function getCss()
{
return parent::getCss() . ' blockquote {margin: 0 0 0 2em;}';
}
开发者ID:ssrsfs,项目名称:blg,代码行数:4,代码来源:setup.php
示例18: paintException
/**
* Paint exception faildetail to STDERR.
*/
function paintException($message)
{
parent::paintException($message);
fwrite(STDERR, 'EXCEPTION' . $this->faildetail_separator . $this->_paintTestFailDetail($message));
}
开发者ID:laiello,项目名称:myopensources,代码行数:8,代码来源:cli_reporter.php
示例19: paintMethodEnd
function paintMethodEnd($test_name)
{
//while(ob_get_status())
// ob_end_clean();
parent::paintMethodEnd($test_name);
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:6,代码来源:EvoUnitTestCase.class.php
示例20: paintPass
function paintPass($message)
{
parent::paintPass($message);
}
开发者ID:tomVertuoz,项目名称:framework,代码行数:4,代码来源:test.php
注:本文中的TextReporter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论