本文整理汇总了PHP中CodeCoverageManager::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP CodeCoverageManager::getInstance方法的具体用法?PHP CodeCoverageManager::getInstance怎么用?PHP CodeCoverageManager::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeCoverageManager
的用法示例。
在下文中一共展示了CodeCoverageManager::getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __getTestFilesPath
/**
* Gets us the base path to look for the test files
*
* @param string $isApp
* @return void
* @access public
*/
function __getTestFilesPath($isApp = true)
{
$manager = CodeCoverageManager::getInstance();
$path = ROOT . DS;
if ($isApp) {
$path .= APP_DIR . DS;
} elseif (!!$manager->pluginTest) {
$pluginPath = APP . 'plugins' . DS . $manager->pluginTest . DS;
$pluginPaths = Configure::read('pluginPaths');
foreach ($pluginPaths as $tmpPath) {
$tmpPath = $tmpPath . $manager->pluginTest . DS;
if (file_exists($tmpPath)) {
$pluginPath = $tmpPath;
break;
}
}
$path = $pluginPath;
} else {
$path = TEST_CAKE_CORE_INCLUDE_PATH;
}
return $path;
}
示例2: testCalculateCodeCoverage
/**
* testCalculateCodeCoverage method
*
* @access public
* @return void
*/
function testCalculateCodeCoverage()
{
$manager =& CodeCoverageManager::getInstance();
$data = array('25' => array(100, 25), '50' => array(100, 50), '0' => array(0, 0), '0' => array(100, 0), '100' => array(100, 100));
foreach ($data as $coverage => $lines) {
$this->assertEqual($coverage, $manager->__calcCoverage($lines[0], $lines[1]));
}
$manager->__calcCoverage(100, 1000);
$this->assertError();
}
示例3: __getTestFilesPath
/**
* Gets us the base path to look for the test files
*
* @param string $isApp
* @return void
* @access public
*/
function __getTestFilesPath($isApp = true)
{
$manager = CodeCoverageManager::getInstance();
$path = ROOT . DS;
if ($isApp) {
$path .= APP_DIR . DS;
} elseif (!!$manager->pluginTest) {
$path .= APP_DIR . DS . 'plugins' . DS . $manager->pluginTest . DS;
} else {
$path = TEST_CAKE_CORE_INCLUDE_PATH;
}
return $path;
}