本文整理匯總了PHP中PHPUnit_Util_Filesystem::getDirectory方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHPUnit_Util_Filesystem::getDirectory方法的具體用法?PHP PHPUnit_Util_Filesystem::getDirectory怎麽用?PHP PHPUnit_Util_Filesystem::getDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PHPUnit_Util_Filesystem
的用法示例。
在下文中一共展示了PHPUnit_Util_Filesystem::getDirectory方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render
/**
* Renders the report.
*
* @param PHPUnit_Framework_TestResult $result
* @param string $target
* @param string $charset
* @param boolean $yui
* @param boolean $highlight
* @param integer $lowUpperBound
* @param integer $highLowerBound
*/
public static function render(PHPUnit_Framework_TestResult $result, $target, $charset = 'ISO-8859-1', $yui = TRUE, $highlight = FALSE, $lowUpperBound = 35, $highLowerBound = 70)
{
$target = PHPUnit_Util_Filesystem::getDirectory($target);
self::$templatePath = sprintf('%s%sReport%sTemplate%s', dirname(__FILE__), DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR);
$codeCoverageInformation = $result->getCodeCoverageInformation();
$files = PHPUnit_Util_CodeCoverage::getSummary($codeCoverageInformation);
$commonPath = PHPUnit_Util_Filesystem::reducePaths($files);
$items = self::buildDirectoryStructure($files);
unset($codeCoverageInformation);
$name = $result->topTestSuite()->getName();
unset($result);
$root = new PHPUnit_Util_Report_Node_Directory($commonPath, NULL);
self::addItems($root, $items, $files, $yui, $highlight);
self::copyFiles($target);
PHPUnit_Util_CodeCoverage::clearSummary();
$root->render($target, $name, $charset, $lowUpperBound, $highLowerBound);
}
示例2: __construct
/**
* @param string $directory
*/
public function __construct($directory)
{
$this->directory = PHPUnit_Util_Filesystem::getDirectory($directory);
}