本文整理汇总了PHP中PHPUnit_Util_Printer::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Util_Printer::__construct方法的具体用法?PHP PHPUnit_Util_Printer::__construct怎么用?PHP PHPUnit_Util_Printer::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Util_Printer
的用法示例。
在下文中一共展示了PHPUnit_Util_Printer::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* Parameter can be set in the phpunit xml configuration file:
* <code>
* <listeners>
* <listener class="..." file="...">
* <arguments>
* <string>...</string><!-- targetFile -->
*
* <string>...</string><!-- directory -->
*
* <array>
* <element key="js/handle.gif">
* <string>###MENTA_ROOTDIR###/PHPUnit/Listener/Resources/Templates/files/handle.gif</string>
* </element>
* <element key="js/jquery.beforeafter-1.4.min.js">
* <string>###MENTA_ROOTDIR###/PHPUnit/Listener/Resources/Templates/files/jquery.beforeafter-1.4.min.js</string>
* </element>
* <!-- ... -->
* </array>
* </arguments>
* </listener>
* </listeners>
* </code>
*
* @param string $targetFile
* @param string $templateFile
* @param array $additionalFiles
* @throws Exception
* @author Fabrizio Branca
*/
public function __construct($targetFile = NULL, $templateFile = NULL, array $additionalFiles = NULL)
{
if (!is_null($targetFile)) {
$this->targetFile = $targetFile;
$this->targetFile = Menta_Util_Div::replaceWithEnvironmentVariables($this->targetFile);
}
$dir = dirname($this->targetFile);
if (!is_dir($dir)) {
throw new Exception("Target dir '{$dir}' does not exist");
}
// clean target dir
foreach (glob($dir . "/*") as $file) {
if (!is_dir($file)) {
unlink($file);
}
}
if (!is_null($templateFile)) {
$this->templateFile = $templateFile;
}
$this->templateFile = str_replace('###MENTA_ROOTDIR###', MENTA_ROOTDIR, $this->templateFile);
if (empty($this->templateFile)) {
throw new Exception('No template file defined');
}
if (!is_null($additionalFiles)) {
$this->additionalFiles = $additionalFiles;
}
parent::__construct($this->targetFile);
}
示例2: __construct
public function __construct($out = null)
{
parent::__construct($out);
self::$instance = $this;
$this->setAutoFlush(true);
$this->fd = fopen("php://fd/3", "w");
}
示例3: __construct
/**
* @param resource $out
* @param array $groups
* @param array $excludeGroups
*/
public function __construct($out = null, array $groups = [], array $excludeGroups = [])
{
parent::__construct($out);
$this->groups = $groups;
$this->excludeGroups = $excludeGroups;
$this->prettifier = new PHPUnit_Util_TestDox_NamePrettifier();
$this->startRun();
}
示例4: __construct
/**
* Constructor.
*
* @param mixed $out
* @param bool $logIncompleteSkipped
*/
public function __construct($out = null, $logIncompleteSkipped = false)
{
$this->document = new DOMDocument('1.0', 'UTF-8');
$this->document->formatOutput = true;
$this->root = $this->document->createElement('testsuites');
$this->document->appendChild($this->root);
parent::__construct($out);
$this->logIncompleteSkipped = $logIncompleteSkipped;
}
示例5: __construct
/**
* @param string|resource $out
*/
public function __construct($out = null)
{
$this->document = new DOMDocument('1.0', 'UTF-8');
$this->document->formatOutput = true;
$this->root = $this->document->createElement('tests');
$this->document->appendChild($this->root);
$this->prettifier = new PHPUnit_Util_TestDox_NamePrettifier();
parent::__construct($out);
}
示例6: __construct
/**
* Constructor.
*
* @param mixed $out
* @param bool $reportUselessTests
*/
public function __construct($out = null, $reportUselessTests = false)
{
$this->document = new DOMDocument('1.0', 'UTF-8');
$this->document->formatOutput = true;
$this->root = $this->document->createElement('testsuites');
$this->document->appendChild($this->root);
parent::__construct($out);
$this->reportUselessTests = $reportUselessTests;
}
示例7: __construct
/**
* {@inheritDoc}
*/
public function __construct($out = null)
{
parent::__construct($out);
if ($this->isDebug()) {
$level = LogLevel::DEBUG;
} elseif ($this->isVerbose()) {
$level = LogLevel::INFO;
} else {
$level = LogLevel::NOTICE;
}
$this->setLogger(new \Psr3ConsoleLogger('PHPUnitPrinterLogger', $level));
}
示例8: __construct
/**
* Constructor.
*
* @param mixed $out
* @param boolean $verbose
* @param boolean $colors
* @param boolean $debug
* @throws InvalidArgumentException
* @since Method available since Release 3.0.0
*/
public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $debug = FALSE)
{
parent::__construct($out);
if (is_bool($verbose)) {
$this->verbose = $verbose;
} else {
throw \PHPUnit_Util_InvalidArgumentHelper::factory(2, 'boolean');
}
if (is_bool($colors)) {
$this->colors = $colors;
} else {
throw \PHPUnit_Util_InvalidArgumentHelper::factory(3, 'boolean');
}
if (is_bool($debug)) {
$this->debug = $debug;
} else {
throw \PHPUnit_Util_InvalidArgumentHelper::factory(4, 'boolean');
}
}
示例9: __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)
{
parent::__construct($out);
if (is_bool($verbose)) {
$this->verbose = $verbose;
} else {
throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'boolean');
}
if (is_bool($colors)) {
$console = new Console();
$this->colors = $colors && $console->hasColorSupport();
} else {
throw PHPUnit_Util_InvalidArgumentHelper::factory(3, 'boolean');
}
if (is_bool($debug)) {
$this->debug = $debug;
} else {
throw PHPUnit_Util_InvalidArgumentHelper::factory(4, 'boolean');
}
}
示例10: __construct
/**
* Constructor.
*
* @param mixed $out
* @param array $configuration
* @throws InvalidArgumentException
*/
public function __construct($out = NULL, array $configuration = array())
{
parent::__construct($out);
$this->loadClasses($configuration);
}
示例11: __construct
/**
* Constructor.
*
* @param mixed $out
*/
public function __construct($out = NULL)
{
if (PHPUnit_Util_Filesystem::fileExistsInIncludePath('Image/GraphViz.php')) {
PHPUnit_Util_Filesystem::collectStart();
require_once 'Image/GraphViz.php';
$this->graph = new Image_GraphViz(TRUE, array('overlap' => 'scale', 'splines' => 'true', 'sep' => '.1', 'fontsize' => '8'));
parent::__construct($out);
foreach (PHPUnit_Util_Filesystem::collectEnd() as $blacklistedFile) {
PHPUnit_Util_Filter::addFileToFilter($blacklistedFile, 'PHPUNIT');
}
} else {
throw new RuntimeException('Image_GraphViz is not available.');
}
}
示例12: __construct
/**
* Constructor.
*
* @param mixed $out
* @param boolean $verbose
* @throws InvalidArgumentException
* @access public
* @since Method available since Release 3.0.0
*/
public function __construct($out = NULL, $verbose = FALSE)
{
parent::__construct($out);
if (is_bool($verbose)) {
$this->verbose = $verbose;
} else {
throw new InvalidArgumentException();
}
}
示例13: __construct
/**
* Constructor.
*
* @param mixed $out
* @param boolean $verbose
* @param boolean $colors
* @param boolean $debug
* @throws InvalidArgumentException
* @since Method available since Release 3.0.0
*/
public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $debug = FALSE)
{
parent::__construct($out);
if (is_bool($colors)) {
$this->colors = $colors;
} else {
throw new InvalidArgumentException();
}
if (is_bool($debug)) {
$this->debug = $debug;
} else {
throw new InvalidArgumentException();
}
if (is_bool($verbose)) {
$this->verbose = $verbose;
} else {
throw new InvalidArgumentException();
}
}
示例14: __construct
/**
* Constructor.
*
* @param mixed $out
* @access public
*/
public function __construct($out = NULL)
{
$this->graph = new Image_GraphViz(TRUE, array('overlap' => 'scale', 'splines' => 'true', 'sep' => '.1', 'fontsize' => '8'));
parent::__construct($out);
}
示例15: __construct
public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $debug = FALSE)
{
parent::__construct($out);
}