本文整理汇总了PHP中PHPUnit_TextUI_ResultPrinter::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_TextUI_ResultPrinter::__construct方法的具体用法?PHP PHPUnit_TextUI_ResultPrinter::__construct怎么用?PHP PHPUnit_TextUI_ResultPrinter::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_TextUI_ResultPrinter
的用法示例。
在下文中一共展示了PHPUnit_TextUI_ResultPrinter::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $debug = FALSE)
{
ob_start();
// start output buffering, so we can send the output to the browser in chunks
$this->autoFlush = true;
parent::__construct($out, $verbose, false, $debug);
}
示例2: __construct
public function __construct($out = null, $verbose = false, $colors = false, $debug = false)
{
parent::__construct($out, $verbose, $colors, $debug);
$this->colors = false;
$this->printsHTML = true;
$this->debug = self::$shouldDebug;
}
示例3: __construct
/**
* {@inheritdoc}
*/
public function __construct($out, $verbose, $colors, $debug, $numberOfColumns)
{
parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns);
if ($html_output_directory = getenv('BROWSERTEST_OUTPUT_DIRECTORY')) {
// Initialize html output debugging.
$html_output_directory = rtrim($html_output_directory, '/');
// Check if directory exists.
if (!is_dir($html_output_directory) || !is_writable($html_output_directory)) {
$this->writeWithColor('bg-red, fg-black', "HTML output directory {$html_output_directory} is not a writable directory.");
} else {
// Convert to a canonicalized absolute pathname just in case the current
// working directory is changed.
$html_output_directory = realpath($html_output_directory);
$this->browserOutputFile = tempnam($html_output_directory, 'browser_output_');
if ($this->browserOutputFile) {
touch($this->browserOutputFile);
} else {
$this->writeWithColor('bg-red, fg-black', "Unable to create a temporary file in {$html_output_directory}.");
}
}
}
if ($this->browserOutputFile) {
putenv('BROWSERTEST_OUTPUT_FILE=' . $this->browserOutputFile);
} else {
// Remove any environment variable.
putenv('BROWSERTEST_OUTPUT_FILE');
}
}
示例4: __construct
/**
* Constructor
*
* @param null $out
* @param bool $verbose
* @param bool $colors
* @param bool $debug
*/
public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $debug = FALSE)
{
parent::__construct($out, $verbose, $colors, $debug);
// this class being used as a printerClass doesn't receive any configuration from PHPUnit.
// that's we need this hack...
if (isset($_SERVER['argv']) && in_array('--colors', $_SERVER['argv'])) {
$this->colors = true;
}
}
示例5: __construct
public function __construct($_blDBResetPerTest = true, $_blDBResetPerSuit = true, $iDBChangeMode = MAINTENANCE_SINGLEROWS, $_iDBChangeOutput = MAINTENANCE_MODE_ONLYRESET, $blVerbose = false)
{
parent::__construct(null, (bool) $blVerbose);
$this->_iDBChangeMode = $iDBChangeMode;
$this->_iDBChangeOutput = $_iDBChangeOutput;
$this->_blDBResetPerTest = $_blDBResetPerTest;
$this->_blDBResetPerSuit = $_blDBResetPerSuit;
$this->_oDBMaintenance = new dbMaintenance();
}
示例6: __construct
/**
* {@inheritdoc}
*/
public function __construct($out = null, $verbose = false, $colors = self::COLOR_DEFAULT, $debug = false, $numberOfColumns = 80)
{
parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns);
if ($numberOfColumns === 'max') {
$console = new Console();
$numberOfColumns = $console->getNumberOfColumns();
}
$this->maxNumberOfColumns = $numberOfColumns;
$this->maxClassNameLength = intval($numberOfColumns * 0.6);
}
示例7: __construct
/**
* Constructor.
*
* @param mixed $out
* @param boolean $verbose
* @param boolean $colors
* @param boolean $debug
*/
public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $debug = FALSE)
{
// Start capturing output
ob_start();
$argv = $_SERVER['argv'];
$colors = in_array('--colors', $argv) || $colors;
$verbose = in_array('--verbose', $argv) || in_array('-v', $argv) || $verbose;
$debug = in_array('--debug', $argv) || $debug;
parent::__construct($out, $verbose, $colors, $debug);
}
示例8: __construct
public function __construct($backtrace, $colors = false)
{
parent::__construct(null, false, $colors);
$this->backtrace = '';
foreach ($backtrace as $trace) {
if (isset($trace['file']) && isset($trace['line'])) {
$this->backtrace .= $trace['file'] . ':' . $trace['line'] . "\n";
}
}
}
示例9: __construct
public function __construct()
{
// ARRGH - PHPUnit does not give us commandline arguments or xml config, so let's hack hard!
if (defined('DEBUG_BACKTRACE_PROVIDE_OBJECT')) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT);
if (isset($backtrace[2]['object']) and $backtrace[2]['object'] instanceof PHPUnit_TextUI_Command) {
list($verbose, $colors, $debug) = Hacky_TextUI_Command_reader::get_settings_hackery($backtrace[2]['object']);
parent::__construct(null, $verbose, $colors, $debug);
return;
}
}
// Fallback if something goes wrong.
parent::__construct(null, false, self::COLOR_DEFAULT, false);
}
示例10: __construct
public function __construct($backtrace, $colors = false)
{
$out = null;
if (php_sapi_name() == 'cli') {
// prevent headers already sent error when started from CLI
$out = 'php://stderr';
}
parent::__construct($out, false, $colors);
$this->backtrace = '';
foreach ($backtrace as $trace) {
if (isset($trace['file']) && isset($trace['line'])) {
$this->backtrace .= $trace['file'] . ':' . $trace['line'] . "\n";
}
}
}
示例11: __construct
public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $debug = FALSE)
{
parent::__construct($out, $verbose, $colors);
if (!empty($_SERVER['COLUMNS'])) {
$this->maxColumns = $_SERVER['COLUMNS'];
} else {
if (function_exists('ncurses_getmaxyx')) {
ncurses_getmaxyx(STDSCR, $height, $this->maxColumns);
} else {
// Try to get it on *nix like systems
exec('resize 2>/dev/null', $output, $ret);
if ($ret === 0 && preg_match('/COLUMNS=([0-9]+)/', $output[0], $m)) {
$this->maxColumns = $m[1];
}
}
}
}
示例12: __construct
/**
* {@inheritDoc}
*/
public function __construct($out = null, $verbose = false, $colors = self::COLOR_DEFAULT, $debug = false, $numberOfColumns = 80)
{
parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns);
if ($this->debug) {
$minLevelOrList = LogLevel::INFO;
} elseif ($this->verbose) {
$minLevelOrList = LogLevel::NOTICE;
} else {
$minLevelOrList = array(LogLevel::NOTICE, LogLevel::ERROR);
}
$console = new \MonologConsoleLogger('ResultPrinter');
$console->setAcceptedLevels($minLevelOrList);
$handlers = $console->getHandlers();
foreach ($handlers as &$handler) {
// attachs processors only to console handler
if ($handler instanceof \Monolog\Handler\FilterHandler) {
// new results presentation when color is supported or not
$handler->pushProcessor(array($this, 'messageProcessor'));
}
}
$this->setLogger($console);
}
示例13: __construct
/**
* {@inheritdoc}
*/
public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $debug = FALSE)
{
$term = empty($_SERVER['TERM']) ? 'unknown' : $_SERVER['TERM'];
$this->fab = \Fab\Factory::getFab($term);
parent::__construct($out, $verbose, true, $debug);
}
示例14: __construct
/**
* Constructor.
*
* @param mixed $out
* @param boolean $verbose
* @param boolean $colors
* @param boolean $debug
* @throws PHPUnit_Framework_Exception
* @since Method available since Release 3.0.0
*/
public function __construct($out = null, $verbose = false, $colors = false, $debug = false, $seed = null)
{
parent::__construct($out, $verbose, $colors, $debug);
$this->seed = $seed;
}
示例15: __construct
public function __construct($out = NULL, $colors = FALSE)
{
parent::__construct($out, false, $colors);
}