public function PHPUnit_TextUI_ResultPrinter::__construct in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php \PHPUnit_TextUI_ResultPrinter::__construct()
Constructor.
@since Method available since Release 3.0.0
Parameters
mixed $out:
bool $verbose:
string $colors:
bool $debug:
int|string $numberOfColumns:
Throws
Overrides PHPUnit_Util_Printer::__construct
File
- vendor/
phpunit/ phpunit/ src/ TextUI/ ResultPrinter.php, line 119
Class
- PHPUnit_TextUI_ResultPrinter
- Prints the result of a TextUI TestRunner run.
Code
public function __construct($out = null, $verbose = false, $colors = self::COLOR_DEFAULT, $debug = false, $numberOfColumns = 80) {
parent::__construct($out);
if (!is_bool($verbose)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'boolean');
}
$availableColors = array(
self::COLOR_NEVER,
self::COLOR_AUTO,
self::COLOR_ALWAYS,
);
if (!in_array($colors, $availableColors)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(3, vsprintf('value from "%s", "%s" or "%s"', $availableColors));
}
if (!is_bool($debug)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(4, 'boolean');
}
if (!is_int($numberOfColumns) && $numberOfColumns != 'max') {
throw PHPUnit_Util_InvalidArgumentHelper::factory(5, 'integer or "max"');
}
$console = new Console();
$maxNumberOfColumns = $console
->getNumberOfColumns();
if ($numberOfColumns == 'max' || $numberOfColumns > $maxNumberOfColumns) {
$numberOfColumns = $maxNumberOfColumns;
}
$this->numberOfColumns = $numberOfColumns;
$this->verbose = $verbose;
$this->debug = $debug;
if ($colors === self::COLOR_AUTO && $console
->hasColorSupport()) {
$this->colors = true;
}
else {
$this->colors = self::COLOR_ALWAYS === $colors;
}
}