本文整理汇总了PHP中PHPUnit_Util_Filter::removeFileFromWhitelist方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Util_Filter::removeFileFromWhitelist方法的具体用法?PHP PHPUnit_Util_Filter::removeFileFromWhitelist怎么用?PHP PHPUnit_Util_Filter::removeFileFromWhitelist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Util_Filter
的用法示例。
在下文中一共展示了PHPUnit_Util_Filter::removeFileFromWhitelist方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleConfiguration
/**
* @param array $arguments
* @since Method available since Release 3.2.1
*/
protected function handleConfiguration(array &$arguments)
{
if (isset($arguments['configuration'])) {
$arguments['configuration'] = new PHPUnit_Util_Configuration($arguments['configuration']);
$arguments['pmd'] = $arguments['configuration']->getPMDConfiguration();
} else {
$arguments['pmd'] = array();
}
$arguments['filter'] = isset($arguments['filter']) ? $arguments['filter'] : FALSE;
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
$arguments['repeat'] = isset($arguments['repeat']) ? $arguments['repeat'] : FALSE;
$arguments['testDatabasePrefix'] = isset($arguments['testDatabasePrefix']) ? $arguments['testDatabasePrefix'] : '';
$arguments['verbose'] = isset($arguments['verbose']) ? $arguments['verbose'] : FALSE;
$arguments['wait'] = isset($arguments['wait']) ? $arguments['wait'] : FALSE;
if (isset($arguments['configuration'])) {
$arguments['configuration']->handlePHPConfiguration();
$filterConfiguration = $arguments['configuration']->getFilterConfiguration();
PHPUnit_Util_Filter::$addUncoveredFilesFromWhitelist = $filterConfiguration['whitelist']['addUncoveredFilesFromWhitelist'];
foreach ($filterConfiguration['blacklist']['include']['directory'] as $dir) {
PHPUnit_Util_Filter::addDirectoryToFilter($dir['path'], $dir['suffix']);
}
foreach ($filterConfiguration['blacklist']['include']['file'] as $file) {
PHPUnit_Util_Filter::addFileToFilter($file);
}
foreach ($filterConfiguration['blacklist']['exclude']['directory'] as $dir) {
PHPUnit_Util_Filter::removeDirectoryFromFilter($dir['path'], $dir['suffix']);
}
foreach ($filterConfiguration['blacklist']['exclude']['file'] as $file) {
PHPUnit_Util_Filter::removeFileFromFilter($file);
}
foreach ($filterConfiguration['whitelist']['include']['directory'] as $dir) {
PHPUnit_Util_Filter::addDirectoryToWhitelist($dir['path'], $dir['suffix']);
}
foreach ($filterConfiguration['whitelist']['include']['file'] as $file) {
PHPUnit_Util_Filter::addFileToWhitelist($file);
}
foreach ($filterConfiguration['whitelist']['exclude']['directory'] as $dir) {
PHPUnit_Util_Filter::removeDirectoryFromWhitelist($dir['path'], $dir['suffix']);
}
foreach ($filterConfiguration['whitelist']['exclude']['file'] as $file) {
PHPUnit_Util_Filter::removeFileFromWhitelist($file);
}
$phpunitConfiguration = $arguments['configuration']->getPHPUnitConfiguration();
if (isset($phpunitConfiguration['ansi']) && !isset($arguments['ansi'])) {
$arguments['ansi'] = $phpunitConfiguration['ansi'];
}
if (isset($phpunitConfiguration['convertErrorsToExceptions']) && !isset($arguments['convertErrorsToExceptions'])) {
$arguments['convertErrorsToExceptions'] = $phpunitConfiguration['convertErrorsToExceptions'];
}
if (isset($phpunitConfiguration['convertNoticesToExceptions']) && !isset($arguments['convertNoticesToExceptions'])) {
$arguments['convertNoticesToExceptions'] = $phpunitConfiguration['convertNoticesToExceptions'];
}
if (isset($phpunitConfiguration['convertWarningsToExceptions']) && !isset($arguments['convertWarningsToExceptions'])) {
$arguments['convertWarningsToExceptions'] = $phpunitConfiguration['convertWarningsToExceptions'];
}
if (isset($phpunitConfiguration['stopOnFailure']) && !isset($arguments['stopOnFailure'])) {
$arguments['stopOnFailure'] = $phpunitConfiguration['stopOnFailure'];
}
$groupConfiguration = $arguments['configuration']->getGroupConfiguration();
if (!empty($groupConfiguration['include']) && !isset($arguments['groups'])) {
$arguments['groups'] = $groupConfiguration['include'];
}
if (!empty($groupConfiguration['exclude']) && !isset($arguments['excludeGroups'])) {
$arguments['excludeGroups'] = $groupConfiguration['exclude'];
}
$loggingConfiguration = $arguments['configuration']->getLoggingConfiguration();
if (isset($loggingConfiguration['coverage-html']) && !isset($arguments['reportDirectory'])) {
if (isset($loggingConfiguration['charset']) && !isset($arguments['reportCharset'])) {
$arguments['reportCharset'] = $loggingConfiguration['charset'];
}
if (isset($loggingConfiguration['yui']) && !isset($arguments['reportYUI'])) {
$arguments['reportYUI'] = $loggingConfiguration['yui'];
}
if (isset($loggingConfiguration['highlight']) && !isset($arguments['reportHighlight'])) {
$arguments['reportHighlight'] = $loggingConfiguration['highlight'];
}
if (isset($loggingConfiguration['lowUpperBound']) && !isset($arguments['reportLowUpperBound'])) {
$arguments['reportLowUpperBound'] = $loggingConfiguration['lowUpperBound'];
}
if (isset($loggingConfiguration['highLowerBound']) && !isset($arguments['reportHighLowerBound'])) {
$arguments['reportHighLowerBound'] = $loggingConfiguration['highLowerBound'];
}
$arguments['reportDirectory'] = $loggingConfiguration['coverage-html'];
}
if (isset($loggingConfiguration['coverage-clover']) && !isset($arguments['coverageClover'])) {
$arguments['coverageClover'] = $loggingConfiguration['coverage-clover'];
}
if (isset($loggingConfiguration['coverage-xml']) && !isset($arguments['coverageClover'])) {
$arguments['coverageClover'] = $loggingConfiguration['coverage-xml'];
}
if (isset($loggingConfiguration['coverage-source']) && !isset($arguments['coverageSource'])) {
$arguments['coverageSource'] = $loggingConfiguration['coverage-source'];
}
if (isset($loggingConfiguration['graphviz']) && !isset($arguments['graphvizLogfile'])) {
$arguments['graphvizLogfile'] = $loggingConfiguration['graphviz'];
}
//.........这里部分代码省略.........
示例2: define
define("SBL_LOG_INFO", 0x1);
define("SBL_LOG_DEBUG", 0x2);
define("SBL_LOG_WARN", 0x4);
define("SBL_LOG_ERR", 0x8);
define("SBL_LOG_ALL", 0xff);
define("SBL_LOG_LEVEL", SBL_LOG_ALL);
if (in_array("-db", $_SERVER["argv"], true)) {
PHPUnit_Util_Filter::addDirectoryToWhitelist(SABEL_BASE . DS . "sabel" . DS . "db");
} else {
PHPUnit_Util_Filter::addDirectoryToWhitelist(SABEL_BASE . DS . "sabel");
PHPUnit_Util_Filter::removeFileFromWhitelist(SABEL_BASE . DS . "sabel" . DS . "Sakle.php");
PHPUnit_Util_Filter::removeDirectoryFromWhitelist(SABEL_BASE . DS . "sabel" . DS . "db");
PHPUnit_Util_Filter::removeDirectoryFromWhitelist(SABEL_BASE . DS . "sabel" . DS . "sakle");
PHPUnit_Util_Filter::removeDirectoryFromWhitelist(SABEL_BASE . DS . "sabel" . DS . "test");
PHPUnit_Util_Filter::removeDirectoryFromWhitelist(SABEL_BASE . DS . "sabel" . DS . "cookie");
PHPUnit_Util_Filter::removeFileFromWhitelist(SABEL_BASE . DS . "sabel" . DS . "response" . DS . "header" . DS . "Http.php");
}
define("TEST_DATA_DIR", SABEL_BASE . DS . "Test" . DS . "data");
define("TEST_APP_DIR", TEST_DATA_DIR . DS . "application");
define("MODULES_DIR_NAME", "app");
define("VIEW_DIR_NAME", "views");
define("LOG_DIR_PATH", TEST_APP_DIR . DS . "logs");
define("MODULES_DIR_PATH", TEST_APP_DIR . DS . "app");
define("COMPILE_DIR_PATH", TEST_APP_DIR . DS . "data" . DS . "compiled");
define("PRODUCTION", 0x1);
define("TEST", 0x2);
define("DEVELOPMENT", 0x4);
define("ENVIRONMENT", TEST);
define("TPL_SUFFIX", ".tpl");
define("SBL_SECURE_MODE", true);
if (!defined("PHPUnit_MAIN_METHOD")) {
示例3: dirname
* @author Yuriy Timofeev <tim4dev@gmail.com>
* @package webacula
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU Public License
*/
require_once dirname(__FILE__) . '/application/bootstrap.php';
require_once dirname(__FILE__) . '/application/controllers/AllTests.php';
require_once dirname(__FILE__) . '/application/models/AllTests.php';
/* какие каталоги учитывать при построении отчета */
if (PHPUnit_Runner_Version::id() >= '3.5.0') {
// PHPUnit 3.5.5
PHP_CodeCoverage_Filter::getInstance()->addDirectoryToWhitelist('../application');
PHP_CodeCoverage_Filter::getInstance()->removeFileFromWhitelist('../application/views/helpers');
} else {
// PHPUnit 3.4
PHPUnit_Util_Filter::addDirectoryToWhitelist('../application');
PHPUnit_Util_Filter::removeFileFromWhitelist('../application/views/helpers');
}
class AllTests
{
public static function main()
{
$parameters = array();
PHPUnit_TextUI_TestRunner::run(self::suite(), $parameters);
}
public static function suite()
{
$suite = new PHPUnit_Framework_TestSuite('Webacula Test Suite');
$suite->addTest(ControllersAllTests::suite());
$suite->addTest(ModelsAllTests::suite());
return $suite;
}
示例4: handleConfiguration
/**
* @param array $arguments
* @since Method available since Release 3.2.1
*/
protected function handleConfiguration(array &$arguments)
{
if (isset($arguments['configuration']) && !$arguments['configuration'] instanceof PHPUnit_Util_Configuration) {
$arguments['configuration'] = PHPUnit_Util_Configuration::getInstance($arguments['configuration']);
$arguments['pmd'] = $arguments['configuration']->getPMDConfiguration();
} else {
$arguments['pmd'] = array();
}
$arguments['debug'] = isset($arguments['debug']) ? $arguments['debug'] : FALSE;
$arguments['filter'] = isset($arguments['filter']) ? $arguments['filter'] : FALSE;
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
$arguments['repeat'] = isset($arguments['repeat']) ? $arguments['repeat'] : FALSE;
$arguments['testDatabasePrefix'] = isset($arguments['testDatabasePrefix']) ? $arguments['testDatabasePrefix'] : '';
$arguments['verbose'] = isset($arguments['verbose']) ? $arguments['verbose'] : FALSE;
$arguments['wait'] = isset($arguments['wait']) ? $arguments['wait'] : FALSE;
if (isset($arguments['configuration'])) {
$arguments['configuration']->handlePHPConfiguration();
$filterConfiguration = $arguments['configuration']->getFilterConfiguration();
PHPUnit_Util_Filter::$addUncoveredFilesFromWhitelist = $filterConfiguration['whitelist']['addUncoveredFilesFromWhitelist'];
foreach ($filterConfiguration['blacklist']['include']['directory'] as $dir) {
PHPUnit_Util_Filter::addDirectoryToFilter($dir['path'], $dir['suffix'], $dir['group'], $dir['prefix']);
}
foreach ($filterConfiguration['blacklist']['include']['file'] as $file) {
PHPUnit_Util_Filter::addFileToFilter($file);
}
foreach ($filterConfiguration['blacklist']['exclude']['directory'] as $dir) {
PHPUnit_Util_Filter::removeDirectoryFromFilter($dir['path'], $dir['suffix'], $dir['group'], $dir['prefix']);
}
foreach ($filterConfiguration['blacklist']['exclude']['file'] as $file) {
PHPUnit_Util_Filter::removeFileFromFilter($file);
}
foreach ($filterConfiguration['whitelist']['include']['directory'] as $dir) {
PHPUnit_Util_Filter::addDirectoryToWhitelist($dir['path'], $dir['suffix'], $dir['prefix']);
}
foreach ($filterConfiguration['whitelist']['include']['file'] as $file) {
PHPUnit_Util_Filter::addFileToWhitelist($file);
}
foreach ($filterConfiguration['whitelist']['exclude']['directory'] as $dir) {
PHPUnit_Util_Filter::removeDirectoryFromWhitelist($dir['path'], $dir['suffix'], $dir['prefix']);
}
foreach ($filterConfiguration['whitelist']['exclude']['file'] as $file) {
PHPUnit_Util_Filter::removeFileFromWhitelist($file);
}
$phpunitConfiguration = $arguments['configuration']->getPHPUnitConfiguration();
if (isset($phpunitConfiguration['backupGlobals']) && !isset($arguments['backupGlobals'])) {
$arguments['backupGlobals'] = $phpunitConfiguration['backupGlobals'];
}
if (isset($phpunitConfiguration['backupStaticAttributes']) && !isset($arguments['backupStaticAttributes'])) {
$arguments['backupStaticAttributes'] = $phpunitConfiguration['backupStaticAttributes'];
}
if (isset($phpunitConfiguration['bootstrap']) && !isset($arguments['bootstrap'])) {
$arguments['bootstrap'] = $phpunitConfiguration['bootstrap'];
}
if (isset($phpunitConfiguration['colors']) && !isset($arguments['colors'])) {
$arguments['colors'] = $phpunitConfiguration['colors'];
}
if (isset($phpunitConfiguration['convertErrorsToExceptions']) && !isset($arguments['convertErrorsToExceptions'])) {
$arguments['convertErrorsToExceptions'] = $phpunitConfiguration['convertErrorsToExceptions'];
}
if (isset($phpunitConfiguration['convertNoticesToExceptions']) && !isset($arguments['convertNoticesToExceptions'])) {
$arguments['convertNoticesToExceptions'] = $phpunitConfiguration['convertNoticesToExceptions'];
}
if (isset($phpunitConfiguration['convertWarningsToExceptions']) && !isset($arguments['convertWarningsToExceptions'])) {
$arguments['convertWarningsToExceptions'] = $phpunitConfiguration['convertWarningsToExceptions'];
}
if (isset($phpunitConfiguration['processIsolation']) && !isset($arguments['processIsolation'])) {
$arguments['processIsolation'] = $phpunitConfiguration['processIsolation'];
}
if (isset($phpunitConfiguration['stopOnFailure']) && !isset($arguments['stopOnFailure'])) {
$arguments['stopOnFailure'] = $phpunitConfiguration['stopOnFailure'];
}
$groupConfiguration = $arguments['configuration']->getGroupConfiguration();
if (!empty($groupConfiguration['include']) && !isset($arguments['groups'])) {
$arguments['groups'] = $groupConfiguration['include'];
}
if (!empty($groupConfiguration['exclude']) && !isset($arguments['excludeGroups'])) {
$arguments['excludeGroups'] = $groupConfiguration['exclude'];
}
foreach ($arguments['configuration']->getListenerConfiguration() as $listener) {
if (!class_exists($listener['class'], FALSE) && $listener['file'] !== '') {
$file = PHPUnit_Util_Filesystem::fileExistsInIncludePath($listener['file']);
if ($file !== FALSE) {
require $file;
}
}
if (class_exists($listener['class'], FALSE)) {
if (count($listener['arguments']) == 0) {
$listener = new $listener['class']();
} else {
$listenerClass = new ReflectionClass($listener['class']);
$listener = $listenerClass->newInstanceArgs($listener['arguments']);
}
if ($listener instanceof PHPUnit_Framework_TestListener) {
$arguments['listeners'][] = $listener;
}
}
//.........这里部分代码省略.........
示例5: removeTestFilesFromWhitelist
protected static function removeTestFilesFromWhitelist($path)
{
$files = recursive_glob($path, true);
foreach ($files as $file) {
if (filetype($file) == 'dir') {
self::removeTestFilesFromWhitelist($file);
} else {
if (substr($file, -8, 8) == 'Test.php') {
PHPUnit_Util_Filter::removeFileFromWhitelist($file);
} else {
if (substr($file, -12, 12) == 'TestCase.php') {
PHPUnit_Util_Filter::removeFileFromWhitelist($file);
}
}
}
}
}
示例6: _blacklist
protected function _blacklist()
{
PHPUnit_Util_Filter::addFileToFilter(__FILE__);
$folders = array('vendor', 'libraries/drivers/Database');
foreach ($folders as $folder) {
$files = self::list_files($folder, TRUE);
foreach ($files as $file) {
if (is_file($file)) {
PHPUnit_Util_Filter::addFileToFilter($file);
PHPUnit_Util_Filter::removeFileFromWhitelist($file);
}
}
}
}
示例7: handleConfiguration
/**
* @param array $arguments
* @access protected
* @since Method available since Release 3.2.1
*/
protected function handleConfiguration(array &$arguments)
{
if (isset($arguments['configuration'])) {
$arguments['configuration'] = new PHPUnit_Util_Configuration($arguments['configuration']);
$arguments['pmd'] = $arguments['configuration']->getPMDConfiguration();
} else {
$arguments['pmd'] = array();
}
$arguments['filter'] = isset($arguments['filter']) ? $arguments['filter'] : FALSE;
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
$arguments['repeat'] = isset($arguments['repeat']) ? $arguments['repeat'] : FALSE;
$arguments['stopOnFailure'] = isset($arguments['stopOnFailure']) ? $arguments['stopOnFailure'] : FALSE;
$arguments['testDatabasePrefix'] = isset($arguments['testDatabasePrefix']) ? $arguments['testDatabasePrefix'] : '';
$arguments['verbose'] = isset($arguments['verbose']) ? $arguments['verbose'] : FALSE;
$arguments['wait'] = isset($arguments['wait']) ? $arguments['wait'] : FALSE;
if (isset($arguments['configuration'])) {
$filterConfiguration = $arguments['configuration']->getFilterConfiguration();
PHPUnit_Util_Filter::$addUncoveredFilesFromWhitelist = $filterConfiguration['whitelist']['addUncoveredFilesFromWhitelist'];
foreach ($filterConfiguration['blacklist']['include']['directory'] as $dir) {
PHPUnit_Util_Filter::addDirectoryToFilter($dir['path'], $dir['suffix']);
}
foreach ($filterConfiguration['blacklist']['include']['file'] as $file) {
PHPUnit_Util_Filter::addFileToFilter($file);
}
foreach ($filterConfiguration['blacklist']['exclude']['directory'] as $dir) {
PHPUnit_Util_Filter::removeDirectoryFromFilter($dir['path'], $dir['suffix']);
}
foreach ($filterConfiguration['blacklist']['exclude']['file'] as $file) {
PHPUnit_Util_Filter::removeFileFromFilter($file);
}
foreach ($filterConfiguration['whitelist']['include']['directory'] as $dir) {
PHPUnit_Util_Filter::addDirectoryToWhitelist($dir['path'], $dir['suffix']);
}
foreach ($filterConfiguration['whitelist']['include']['file'] as $file) {
PHPUnit_Util_Filter::addFileToWhitelist($file);
}
foreach ($filterConfiguration['whitelist']['exclude']['directory'] as $dir) {
PHPUnit_Util_Filter::removeDirectoryFromWhitelist($dir['path'], $dir['suffix']);
}
foreach ($filterConfiguration['whitelist']['exclude']['file'] as $file) {
PHPUnit_Util_Filter::removeFileFromWhitelist($file);
}
$phpConfiguration = $arguments['configuration']->getPHPConfiguration();
foreach ($phpConfiguration['ini'] as $name => $value) {
ini_set($name, $value);
}
foreach ($phpConfiguration['var'] as $name => $value) {
$GLOBALS[$name] = $value;
}
$groupConfiguration = $arguments['configuration']->getGroupConfiguration();
if (!empty($groupConfiguration['include']) && !isset($arguments['groups'])) {
$arguments['groups'] = $groupConfiguration['include'];
}
if (!empty($groupConfiguration['exclude']) && !isset($arguments['excludeGroups'])) {
$arguments['excludeGroups'] = $groupConfiguration['exclude'];
}
$loggingConfiguration = $arguments['configuration']->getLoggingConfiguration();
if (isset($loggingConfiguration['coverage-html']) && !isset($arguments['reportDirectory'])) {
if (isset($loggingConfiguration['charset']) && !isset($arguments['reportCharset'])) {
$arguments['reportCharset'] = $loggingConfiguration['charset'];
}
if (isset($loggingConfiguration['yui']) && !isset($arguments['reportYUI'])) {
$arguments['reportYUI'] = $loggingConfiguration['yui'];
}
if (isset($loggingConfiguration['highlight']) && !isset($arguments['reportHighlight'])) {
$arguments['reportHighlight'] = $loggingConfiguration['highlight'];
}
if (isset($loggingConfiguration['lowUpperBound']) && !isset($arguments['reportLowUpperBound'])) {
$arguments['reportLowUpperBound'] = $loggingConfiguration['lowUpperBound'];
}
if (isset($loggingConfiguration['highLowerBound']) && !isset($arguments['reportHighLowerBound'])) {
$arguments['reportHighLowerBound'] = $loggingConfiguration['highLowerBound'];
}
$arguments['reportDirectory'] = $loggingConfiguration['coverage-html'];
}
if (isset($loggingConfiguration['coverage-xml']) && !isset($arguments['coverageXML'])) {
$arguments['coverageXML'] = $loggingConfiguration['coverage-xml'];
}
if (isset($loggingConfiguration['graphviz']) && !isset($arguments['graphvizLogfile'])) {
$arguments['graphvizLogfile'] = $loggingConfiguration['graphviz'];
}
if (isset($loggingConfiguration['json']) && !isset($arguments['jsonLogfile'])) {
$arguments['jsonLogfile'] = $loggingConfiguration['json'];
}
if (isset($loggingConfiguration['metrics-xml']) && !isset($arguments['metricsXML'])) {
$arguments['metricsXML'] = $loggingConfiguration['metrics-xml'];
}
if (isset($loggingConfiguration['plain'])) {
$arguments['listeners'][] = new PHPUnit_TextUI_ResultPrinter($loggingConfiguration['plain'], TRUE);
}
if (isset($loggingConfiguration['pmd-xml']) && !isset($arguments['pmdXML'])) {
if (isset($loggingConfiguration['cpdMinLines']) && !isset($arguments['cpdMinLines'])) {
$arguments['cpdMinLines'] = $loggingConfiguration['cpdMinLines'];
}
if (isset($loggingConfiguration['cpdMinMatches']) && !isset($arguments['cpdMinMatches'])) {
//.........这里部分代码省略.........