当前位置: 首页>>代码示例>>PHP>>正文


PHP PHP_CodeCoverage_Filter::getInstance方法代码示例

本文整理汇总了PHP中PHP_CodeCoverage_Filter::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP PHP_CodeCoverage_Filter::getInstance方法的具体用法?PHP PHP_CodeCoverage_Filter::getInstance怎么用?PHP PHP_CodeCoverage_Filter::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHP_CodeCoverage_Filter的用法示例。


在下文中一共展示了PHP_CodeCoverage_Filter::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: startTestSuite

 /**
  * Add Mockery files to PHPUnit's blacklist so they don't showup on coverage reports
  */
 public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
 {
     if (class_exists('\\PHP_CodeCoverage_Filter') && method_exists('\\PHP_CodeCoverage_Filter', 'getInstance')) {
         \PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(__DIR__ . '/../../../Mockery/', '.php', '', 'PHPUNIT');
         \PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__DIR__ . '/../../../Mockery.php', 'PHPUNIT');
     }
 }
开发者ID:ngitimfoyo,项目名称:Nyari-AppPHP,代码行数:10,代码来源:TestListener.php

示例2: getCodeCoverageFilter

 /**
  * Get the code coverage filter instance we will use for tests.
  * When running PHPUnit 3.5, this will return the singleton instance.
  * When running PHPUnit 3.6, this will return the instance we hold internally;
  * this same instance will be passed to PHPUnit in AgaviTesting::dispatch().
  *
  * @return     PHP_CodeCoverage_Filter The code coverage filter for our tests.
  *
  * @author     David Zülke <david.zuelke@bitextender.com>
  * @since      1.0.7
  * @deprecated 1.1.0 Use AgaviPhpUnitCli
  */
 public static function getCodeCoverageFilter()
 {
     if (self::$codeCoverageFilter === null) {
         // PHP_CodeCoverage doesn't expose any version info, we'll have to check if there is a static getInstance method
         self::$codeCoverageFilter = method_exists('PHP_CodeCoverage_Filter', 'getInstance') ? PHP_CodeCoverage_Filter::getInstance() : new PHP_CodeCoverage_Filter();
     }
     return self::$codeCoverageFilter;
 }
开发者ID:horros,项目名称:agavi,代码行数:20,代码来源:AgaviTesting.class.php

示例3: init

 /** 
  * Initialise the wrapper class.
  */
 public function init()
 {
     require_once 'PHP/CodeCoverage.php';
     require_once 'PHP/CodeCoverage/Report/HTML.php';
     require_once 'PHPUnit/Autoload.php';
     require_once 'PHP/CodeCoverage/Filter.php';
     PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'PHPUNIT');
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:11,代码来源:PhpUnitWrapper_3_5.php

示例4: setUp

 /**
  * Set up the test suite.
  *
  * @return void
  * @access protected
  */
 protected function setUp()
 {
     // Update the code coverage blacklist -- we don't want to analyze all the
     // test code or any external PEAR libraries that we include:
     PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist('/usr/share/php');
     PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist('/usr/local/lib');
     PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(dirname(__FILE__));
     // Clear out Smarty files to ensure testing begins with a clean slate:
     $this->_smartyCleanup();
 }
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:16,代码来源:AllTests.php

示例5: phpunit_autoload

 function phpunit_autoload($class)
 {
     if (strpos($class, 'PHPUnit_') === 0) {
         $file = str_replace('_', '/', $class) . '.php';
         $file = PHPUnit_Util_Filesystem::fileExistsInIncludePath($file);
         if ($file) {
             require_once $file;
             PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist($file, 'PHPUNIT');
         }
     }
 }
开发者ID:rmehner,项目名称:phpunit,代码行数:11,代码来源:Autoload.php

示例6: setCodeCoverageIgnores

	protected function setCodeCoverageIgnores()
	{
		$codeCoverageFilter = PHP_CodeCoverage_Filter::getInstance();
		$codeCoverageFilter->addDirectoryToBlacklist(dirname(__FILE__));
		
		foreach($this->codeCoverageIgnoreDirectoryList as $oneDirectory)
		{
			$codeCoverageFilter->addDirectoryToBlacklist($oneDirectory);
		}
		
		$codeCoverageFilter->addFilesToBlackList($this->codeCoverageIgnoreFileList);
	}
开发者ID:ramielrowe,项目名称:Radford-Reservation-System,代码行数:12,代码来源:TestRunner.php

示例7: init

 /**
  * Initializes the Spec library
  *
  * @static
  * @param bool $autoload    Unless it's false it will register a custom autoloader
  * @return bool
  */
 public static function init($autoload = true)
 {
     static $alreadyInitialized = false;
     if ($alreadyInitialized) {
         return false;
     }
     // Register auto loader
     if ($autoload) {
         self::autoload();
     }
     // Register stream wrapper for spec files
     $scheme = self::SCHEME;
     if (!in_array($scheme, stream_get_wrappers())) {
         // Get loaded extensions
         $extensions = array_merge(get_loaded_extensions(), get_loaded_extensions(true));
         // Check if the Suhosin patch is loaded
         if (in_array('suhosin', $extensions)) {
             $list = ini_get('suhosin.executor.include.whitelist');
             $list = explode(',', $list);
             $list = array_filter(array_map('trim', $list));
             if (!in_array($scheme, $list)) {
                 throw new \RuntimeException("The Suhosin patch has been detected but the custom '{$scheme}' scheme was not found as allowed. " . "Please review your php.ini settings to include '{$scheme}' in 'suhosin.executor.include.whitelist'.");
             }
         }
         stream_wrapper_register($scheme, __NAMESPACE__ . '\\Spec\\StreamWrapper');
     }
     // Black list Spec files for PHPUnit
     if (class_exists('\\PHP_CodeCoverage_Filter', false)) {
         $filter = \PHP_CodeCoverage_Filter::getInstance();
         $filter->addFileToBlacklist(__FILE__, 'PHPUNIT');
         $filter->addDirectoryToBlacklist(__DIR__ . DIRECTORY_SEPARATOR . 'Spec', '.php', '', 'PHPUNIT', FALSE);
         // Also add Hamcrest matcher library from the include path
         $paths = explode(PATH_SEPARATOR, get_include_path());
         foreach ($paths as $path) {
             if (is_file($path . DIRECTORY_SEPARATOR . 'Hamcrest/MatcherAssert.php')) {
                 $filter->addDirectoryToBlacklist($path . DIRECTORY_SEPARATOR . 'Hamcrest', '.php', '', 'PHPUNIT', FALSE);
                 break;
             }
         }
     }
     // include standard matchers and keywords
     include_once __DIR__ . '/Spec/keywords.php';
     include_once __DIR__ . '/Spec/matchers.php';
     // Setup suite stack
     self::$suites = new \SplStack();
     return true;
 }
开发者ID:rafeca,项目名称:Spec-PHP,代码行数:54,代码来源:Spec.php

示例8: createRunner

 protected function createRunner()
 {
     if ($this->version36) {
         $filter = new PHP_CodeCoverage_Filter();
     } else {
         $filter = PHP_CodeCoverage_Filter::getInstance();
     }
     $filter->addFileToBlacklist(__FILE__, 'PHPUNIT');
     $filter->addFileToBlacklist(__DIR__ . '/JelixTestSuite.class.php', 'PHPUNIT');
     $filter->addFileToBlacklist(__DIR__ . '/junittestcase.class.php', 'PHPUNIT');
     $filter->addFileToBlacklist(__DIR__ . '/junittestcasedb.class.php', 'PHPUNIT');
     $filter->addFileToBlacklist(dirname(__DIR__) . '/phpunit.inc.php', 'PHPUNIT');
     if ($this->version36) {
         return new PHPUnit_TextUI_TestRunner($this->arguments['loader'], $filter);
     } else {
         return new PHPUnit_TextUI_TestRunner($this->arguments['loader']);
     }
 }
开发者ID:CREASIG,项目名称:lizmap-web-client,代码行数:18,代码来源:command.php

示例9: setWhiteAndBlacklists

 /**
  * Set white / black lists
  */
 public function setWhiteAndBlacklists()
 {
     if ($this->isPhpunitVersionGreaterOrEquals("3.6.0")) {
         // TODO not sure if this is working - we need to validate that
         $filter = new PHP_CodeCoverage_Filter();
         $filter->addDirectoryToBlacklist(PATH_TO_TEST_DIR);
         $filter->addDirectoryToBlacklist(PATH_TO_TINE_LIBRARY);
         $filter->addDirectoryToBlacklist(PATH_TO_REAL_DIR . '/Setup');
         $filter->addDirectoryToBlacklist(PATH_TO_REAL_DIR . '/Zend');
         $filter->addDirectoryToBlacklist(PATH_TO_REAL_DIR . '/vendor');
     } else {
         if ($this->isPhpunitVersionGreaterOrEquals("3.5.0")) {
             PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(PATH_TO_TEST_DIR);
             PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(PATH_TO_TINE_LIBRARY);
             PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(PATH_TO_REAL_DIR . '/Setup');
             PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(PATH_TO_REAL_DIR . '/Zend');
         } else {
             PHPUnit_Util_Filter::addDirectoryToFilter(PATH_TO_TEST_DIR);
             PHPUnit_Util_Filter::addDirectoryToFilter(PATH_TO_TINE_LIBRARY);
             PHPUnit_Util_Filter::addDirectoryToFilter(PATH_TO_REAL_DIR . '/Setup');
             PHPUnit_Util_Filter::addDirectoryToFilter(PATH_TO_REAL_DIR . '/Zend');
         }
     }
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:27,代码来源:TestServer.php

示例10: dirname

 *
 * (c) 2011 Jan Sorgalla <jan.sorgalla@dotsunited.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
// Get base and application path
$rootPath = dirname(__DIR__);
set_include_path(implode(PATH_SEPARATOR, array($rootPath . '/tests', $rootPath . '/src', get_include_path())));
// Setup autoloading
spl_autoload_register(function ($className) {
    if (strpos($className, 'PHPUnit_') === false && strpos($className, 'DotsUnited\\') === false) {
        return;
    }
    if (false !== strripos($className, '\\')) {
        $replace = '\\';
    } else {
        $replace = '_';
    }
    require str_replace($replace, DIRECTORY_SEPARATOR, $className) . '.php';
}, true, true);
// Define filters for clover report
PHP_CodeCoverage_Filter::getInstance()->addDirectoryToWhitelist($rootPath . '/src');
PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist($rootPath . '/tests');
if (defined('PEAR_INSTALL_DIR') && is_dir(PEAR_INSTALL_DIR)) {
    PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(PEAR_INSTALL_DIR);
}
if (defined('PHP_LIBDIR') && is_dir(PEAR_INSTALL_DIR)) {
    PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(PHP_LIBDIR);
}
unset($rootPath);
开发者ID:rafal-kos,项目名称:BundleFu,代码行数:31,代码来源:bootstrap.php

示例11: phpunit_autoload


//.........这里部分代码省略.........
          'phpunit_util_diff' => '/Util/Diff.php',
          'phpunit_util_type' => '/Util/Type.php',
          'phpunit_util_log_dbus' => '/Util/Log/DBUS.php',
          'phpunit_util_log_junit' => '/Util/Log/JUnit.php',
          'phpunit_util_log_tap' => '/Util/Log/TAP.php',
          'phpunit_util_log_xhprof' => '/Util/Log/XHProf.php',
          'phpunit_util_log_json' => '/Util/Log/JSON.php',
          'phpunit_framework_testlistener' => '/Framework/TestListener.php',
          'phpunit_framework_assert' => '/Framework/Assert.php',
          'phpunit_framework_test' => '/Framework/Test.php',
          'phpunit_framework_warning' => '/Framework/Warning.php',
          'phpunit_framework_comparisonfailure' => '/Framework/ComparisonFailure.php',
          'phpunit_framework_incompletetest' => '/Framework/IncompleteTest.php',
          'phpunit_framework_syntheticerror' => '/Framework/SyntheticError.php',
          'phpunit_framework_testresult' => '/Framework/TestResult.php',
          'phpunit_framework_expectationfailedexception' => '/Framework/ExpectationFailedException.php',
          'phpunit_framework_error' => '/Framework/Error.php',
          'phpunit_framework_testcase' => '/Framework/TestCase.php',
          'phpunit_framework_error_warning' => '/Framework/Error/Warning.php',
          'phpunit_framework_error_notice' => '/Framework/Error/Notice.php',
          'phpunit_framework_testsuite_dataprovider' => '/Framework/TestSuite/DataProvider.php',
          'phpunit_framework_constraint' => '/Framework/Constraint.php',
          'phpunit_framework_skippedtestsuiteerror' => '/Framework/SkippedTestSuiteError.php',
          'phpunit_framework_comparisonfailure_object' => '/Framework/ComparisonFailure/Object.php',
          'phpunit_framework_comparisonfailure_scalar' => '/Framework/ComparisonFailure/Scalar.php',
          'phpunit_framework_comparisonfailure_array' => '/Framework/ComparisonFailure/Array.php',
          'phpunit_framework_comparisonfailure_string' => '/Framework/ComparisonFailure/String.php',
          'phpunit_framework_comparisonfailure_type' => '/Framework/ComparisonFailure/Type.php',
          'phpunit_framework_testfailure' => '/Framework/TestFailure.php',
          'phpunit_framework_exception' => '/Framework/Exception.php',
          'phpunit_framework_skippedtest' => '/Framework/SkippedTest.php',
          'phpunit_framework_incompletetesterror' => '/Framework/IncompleteTestError.php',
          'phpunit_framework_selfdescribing' => '/Framework/SelfDescribing.php',
          'phpunit_framework_testsuite' => '/Framework/TestSuite.php',
          'phpunit_framework_skippedtesterror' => '/Framework/SkippedTestError.php',
          'phpunit_framework_constraint_isempty' => '/Framework/Constraint/IsEmpty.php',
          'phpunit_framework_constraint_stringcontains' => '/Framework/Constraint/StringContains.php',
          'phpunit_framework_constraint_stringstartswith' => '/Framework/Constraint/StringStartsWith.php',
          'phpunit_framework_constraint_and' => '/Framework/Constraint/And.php',
          'phpunit_framework_constraint_isanything' => '/Framework/Constraint/IsAnything.php',
          'phpunit_framework_constraint_isequal' => '/Framework/Constraint/IsEqual.php',
          'phpunit_framework_constraint_isfalse' => '/Framework/Constraint/IsFalse.php',
          'phpunit_framework_constraint_traversablecontainsonly' => '/Framework/Constraint/TraversableContainsOnly.php',
          'phpunit_framework_constraint_istype' => '/Framework/Constraint/IsType.php',
          'phpunit_framework_constraint_attribute' => '/Framework/Constraint/Attribute.php',
          'phpunit_framework_constraint_isinstanceof' => '/Framework/Constraint/IsInstanceOf.php',
          'phpunit_framework_constraint_greaterthan' => '/Framework/Constraint/GreaterThan.php',
          'phpunit_framework_constraint_or' => '/Framework/Constraint/Or.php',
          'phpunit_framework_constraint_not' => '/Framework/Constraint/Not.php',
          'phpunit_framework_constraint_objecthasattribute' => '/Framework/Constraint/ObjectHasAttribute.php',
          'phpunit_framework_constraint_lessthan' => '/Framework/Constraint/LessThan.php',
          'phpunit_framework_constraint_traversablecontains' => '/Framework/Constraint/TraversableContains.php',
          'phpunit_framework_constraint_stringmatches' => '/Framework/Constraint/StringMatches.php',
          'phpunit_framework_constraint_classhasattribute' => '/Framework/Constraint/ClassHasAttribute.php',
          'phpunit_framework_constraint_fileexists' => '/Framework/Constraint/FileExists.php',
          'phpunit_framework_constraint_xor' => '/Framework/Constraint/Xor.php',
          'phpunit_framework_constraint_isidentical' => '/Framework/Constraint/IsIdentical.php',
          'phpunit_framework_constraint_count' => '/Framework/Constraint/Count.php',
          'phpunit_framework_constraint_arrayhaskey' => '/Framework/Constraint/ArrayHasKey.php',
          'phpunit_framework_constraint_classhasstaticattribute' => '/Framework/Constraint/ClassHasStaticAttribute.php',
          'phpunit_framework_constraint_stringendswith' => '/Framework/Constraint/StringEndsWith.php',
          'phpunit_framework_constraint_pcrematch' => '/Framework/Constraint/PCREMatch.php',
          'phpunit_framework_constraint_isnull' => '/Framework/Constraint/IsNull.php',
          'phpunit_framework_constraint_istrue' => '/Framework/Constraint/IsTrue.php',
          'phpunit_framework_assertionfailederror' => '/Framework/AssertionFailedError.php',
          'phpunit_extensions_repeatedtest' => '/Extensions/RepeatedTest.php',
          'phpunit_extensions_phpttestcase' => '/Extensions/PhptTestCase.php',
          'phpunit_extensions_ticketlistener' => '/Extensions/TicketListener.php',
          'phpunit_extensions_phpttestcase_logger' => '/Extensions/PhptTestCase/Logger.php',
          'phpunit_extensions_outputtestcase' => '/Extensions/OutputTestCase.php',
          'phpunit_extensions_ticketlistener_trac' => '/Extensions/TicketListener/Trac.php',
          'phpunit_extensions_ticketlistener_googlecode' => '/Extensions/TicketListener/GoogleCode.php',
          'phpunit_extensions_ticketlistener_github' => '/Extensions/TicketListener/GitHub.php',
          'phpunit_extensions_grouptestsuite' => '/Extensions/GroupTestSuite.php',
          'phpunit_extensions_phpttestsuite' => '/Extensions/PhptTestSuite.php',
          'phpunit_extensions_testdecorator' => '/Extensions/TestDecorator.php',
          'phpunit_textui_resultprinter' => '/TextUI/ResultPrinter.php',
          'phpunit_textui_command' => '/TextUI/Command.php',
          'phpunit_textui_testrunner' => '/TextUI/TestRunner.php',
          'phpunit_runner_standardtestsuiteloader' => '/Runner/StandardTestSuiteLoader.php',
          'phpunit_runner_version' => '/Runner/Version.php',
          'phpunit_runner_basetestrunner' => '/Runner/BaseTestRunner.php',
          'phpunit_runner_testsuiteloader' => '/Runner/TestSuiteLoader.php'
        );

        $path = dirname(__FILE__);

        $filter = PHP_CodeCoverage_Filter::getInstance();
    }

    $cn = strtolower($class);

    if (isset($classes[$cn])) {
        $file = $path . $classes[$cn];

        require $file;

        $filter->addFileToBlackList($file, 'PHPUNIT');
    }
}
开发者ID:naderman,项目名称:phpunit,代码行数:101,代码来源:Autoload.php

示例12: define

}
if (!defined('SELENIUM_SERVER')) {
    define('SELENIUM_SERVER', 'cormorant.crtdev.local');
}
if (!defined('TESTS_LOG_DIR')) {
    define('TESTS_LOG_DIR', LC_DIR_VAR . 'log' . LC_DS);
}
if (isset($_SERVER['argv']) && preg_match('/--log-xml\\s+(\\S+)\\s/s', implode(' ', $_SERVER['argv']), $match)) {
    XLite_Tests_MetricWriter::init($match[1] . '.speed');
    unset($match);
}
if (!defined('INCLUDE_ONLY_TESTS') || !preg_match('/DEPLOY_/', constant('INCLUDE_ONLY_TESTS'))) {
    PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(PATH_ROOT . LC_DS . '.dev');
    PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(PATH_SRC . LC_DS . 'etc');
    PHP_CodeCoverage_Filter::getInstance()->addDirectoryToWhitelist(PATH_SRC . LC_DS . 'var' . LC_DS . 'run' . LC_DS . 'classes');
    PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(PATH_SRC . LC_DS . 'var' . LC_DS . 'run' . LC_DS . 'classes' . LC_DS . 'XLite' . LC_DS . 'Model' . LC_DS . 'Proxy');
}
foreach (glob(LC_DIR_ROOT . 'var/log/selenium.*.html') as $f) {
    @unlink($f);
}
/**
 * Class to sort out files gathered by RecursiveIteratorIterator
 *
 * @package    X-Lite_Tests
 * @subpackage Main
 * @see        ____class_see____
 * @since      1.0.10
 */
class XLite_Tests_SortedIterator extends SplHeap
{
    public function __construct(Iterator $iterator)
开发者ID:kingsj,项目名称:core,代码行数:31,代码来源:AllTests_no_restore.php

示例13: finfo_open

                break;
            default:
                $finfo = finfo_open();
                $mime = finfo_file($finfo, $file, FILEINFO_MIME);
                finfo_close($finfo);
                break;
        }
        $size = filesize($file);
        $time = filemtime($file);
        header('HTTP/1.1 200 OK');
        header('Content-Type: ' . $mime);
        header('Content-Length: ' . $size);
        header('Etag: ' . md5("{$size}-{$time}"));
        header('Last-Modified: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', $time));
        readfile($file);
    } else {
        header('HTTP/1.0 404 Not Found');
    }
    exit(0);
}
require $config['phpunit'] . 'PHPUnit/Autoload.php';
$filter = PHP_CodeCoverage_Filter::getInstance();
$filter->addDirectoryToBlacklist(__DIR__, '.php', '', 'PHPUNIT', FALSE);
$filter->addDirectoryToBlacklist(__DIR__ . '/templates', '.php', '', 'PHPUNIT', FALSE);
$filter->addDirectoryToBlacklist($config['tpldir'], '.php', '', 'PHPUNIT', FALSE);
$filter->addFileToBlacklist(__FILE__, 'PHPUNIT', FALSE);
$filter->addFileToBlacklist($_SERVER['SCRIPT_FILENAME'], 'PHPUNIT', FALSE);
require __DIR__ . '/PHPUnit_Html_Printer.php';
require __DIR__ . '/PHPUnit_Html_TestRunner.php';
PHPUnit_HTML_TestRunner::run($config);
/* vim: set expandtab tabstop=4 shiftwidth=4: */
开发者ID:phpgit,项目名称:PHPUnit_Html,代码行数:31,代码来源:main.php

示例14: jimport

jimport('joomla.session.session');

// We need also these:
jimport('joomla.plugin.helper');

$_SERVER['HTTP_HOST'] = 'http://localhost';
$_SERVER['REQUEST_URI'] = '/index.php';
//$_SERVER['REMOTE_ADDR'] = '127.0.0.1';

$app = JFactory::getApplication('site');

if (!defined('KPATH_TESTS'))
{
	define('KPATH_TESTS', dirname(__FILE__));
}

// Exclude all of the tests from code coverage reports
if (class_exists('PHP_CodeCoverage_Filter')) {
	PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(JPATH_BASE . '/tests');
} else {
	PHPUnit_Util_Filter::addDirectoryToFilter(JPATH_BASE . '/tests');
}

// Set error handling.
JError::setErrorHandling(E_NOTICE, 'ignore');
JError::setErrorHandling(E_WARNING, 'ignore');
JError::setErrorHandling(E_ERROR, 'ignore');

// Load Kunena API
require_once JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
KunenaFactory::loadLanguage();
开发者ID:GoremanX,项目名称:Kunena-2.0,代码行数:31,代码来源:bootstrap.php

示例15: define

//PHP_CodeCoverage_Filter::getInstance()->addDirectoryToWhitelist(TESTS_PATH . '/../Lib');
$useLowerCase = false;
if (is_dir(TESTS_PATH . '/../lib/nimbles')) {
    $useLowerCase = true;
    define('NIMBLES_PATH', realpath(TESTS_PATH . '/../lib'));
    define('NIMBLES_LIBRARY', realpath(TESTS_PATH . '/../lib/nimbles'));
} else {
    define('NIMBLES_PATH', realpath(TESTS_PATH . '/../Lib'));
    define('NIMBLES_LIBRARY', realpath(TESTS_PATH . '/../Lib/Nimbles'));
}
$dirs = scandir(NIMBLES_LIBRARY);
$testFiles = array();
foreach ($dirs as $dir) {
    if (false !== ($testcase = realpath(NIMBLES_LIBRARY . $dir . ($useLowerCase ? '/testcase.php' : '/TestCase.php')))) {
        $testFiles[] = $testcase;
    }
    if (false !== ($testsuite = realpath(NIMBLES_LIBRARY . $dir . ($useLowerCase ? '/testsuite.php' : '/TestSuite.php')))) {
        $testFiles[] = $testsuite;
    }
}
PHP_CodeCoverage_Filter::getInstance()->addFilesToBlacklist($testFiles);
PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(TESTS_PATH, array('.php', '.inc'));
// surpress warnings if timezone has not been set on the system
date_default_timezone_set(@date_default_timezone_get());
if (file_exists(NIMBLES_PATH . '/nimbles.php')) {
    require_once realpath(NIMBLES_PATH . '/nimbles.php');
} else {
    require_once realpath(NIMBLES_PATH . '/Nimbles.php');
}
new Nimbles();
set_include_path(get_include_path() . PATH_SEPARATOR . realpath(TESTS_PATH . '/..'));
开发者ID:nimbles,项目名称:Framework,代码行数:31,代码来源:bootstrap.php


注:本文中的PHP_CodeCoverage_Filter::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。