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


PHP PHPUnit_Util_Filter::addDirectoryToWhitelist方法代码示例

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


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

示例1: __construct

 /**
  * Constructs a new test suite instance.
  */
 public function __construct()
 {
     $this->setName('org::pdepend::reflection::resolvers::AllTests');
     \PHPUnit_Util_Filter::addDirectoryToWhitelist(realpath(dirname(__FILE__) . '/../../source/'));
     $this->addTestSuite('\\pdepend\\reflection\\resolvers\\AutoloadArrayResolverTest');
     $this->addTestSuite('\\pdepend\\reflection\\resolvers\\PearNamingResolverTest');
 }
开发者ID:naderman,项目名称:static-reflection,代码行数:10,代码来源:AllTests.php

示例2: __construct

 /**
  * Constructs a new test suite instance.
  */
 public function __construct()
 {
     $this->setName('PHP::ChangeCoverage::Report::AllTests');
     PHPUnit_Util_Filter::addDirectoryToWhitelist(realpath(dirname(__FILE__) . '/../../../../source/'));
     $this->addTestSuite('PHP_ChangeCoverage_Report_CloverUnitTest');
     $this->addTestSuite('PHP_ChangeCoverage_Report_FactoryUnitTest');
 }
开发者ID:johnkramlich,项目名称:php-change-coverage,代码行数:10,代码来源:AllTests.php

示例3: __construct

 /**
  * Constructs a new test suite instance.
  */
 public function __construct()
 {
     $this->setName('PHP::ChangeCoverage::AllTests');
     PHPUnit_Util_Filter::addDirectoryToWhitelist(realpath(dirname(__FILE__) . '/../../../source/'));
     $this->addTest(PHP_ChangeCoverage_ChangeSet_AllTests::suite());
     $this->addTest(PHP_ChangeCoverage_Source_AllTests::suite());
     $this->addTest(PHP_ChangeCoverage_Report_AllTests::suite());
     $this->addTestSuite('PHP_ChangeCoverage_PHPUnitUnitTest');
     $this->addTestSuite('PHP_ChangeCoverage_XdebugUnitTest');
 }
开发者ID:johnkramlich,项目名称:php-change-coverage,代码行数:13,代码来源:AllTests.php

示例4: suite

 public static function suite()
 {
     if (!defined('PHPUNIT_TESTSUITE_WHITELIST_PREPARED')) {
         PHPUnit_Util_Filter::addDirectoryToWhitelist(dirname(dirname(dirname(__FILE__))));
         PHPUnit_Util_Filter::removeDirectoryFromWhitelist(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'Samples');
         PHPUnit_Util_Filter::removeDirectoryFromWhitelist(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'Tests');
         define('PHPUNIT_TESTSUITE_WHITELIST_PREPARED', TRUE);
     }
     $suite = new PHPUnit_Framework_TestSuite('PHPUnit_Util');
     $suite->addTest(Util_Log_AllTests::suite());
     $suite->addTest(Util_TestDox_AllTests::suite());
     $suite->addTestSuite('Util_TimerTest');
     return $suite;
 }
开发者ID:ahmedadham88,项目名称:enhanced-social-network,代码行数:14,代码来源:AllTests.php

示例5: __construct

 /**
  * Constructs a new test suite instance.
  */
 public function __construct()
 {
     $this->setName('org::pdepend::reflection::AllTests');
     \PHPUnit_Util_Filter::addDirectoryToWhitelist(realpath(dirname(__FILE__) . '/../source/'));
     $this->addTestSuite('\\pdepend\\reflection\\AutoloaderTest');
     $this->addTestSuite('\\pdepend\\reflection\\ReflectionClassProxyTest');
     $this->addTestSuite('\\pdepend\\reflection\\ReflectionClassCacheTest');
     $this->addTestSuite('\\pdepend\\reflection\\ReflectionClassProxyContextTest');
     $this->addTest(api\AllTests::suite());
     $this->addTest(factories\AllTests::suite());
     $this->addTest(parser\AllTests::suite());
     $this->addTest(queries\AllTests::suite());
     $this->addTest(resolvers\AllTests::suite());
     $this->addTestSuite('\\pdepend\\reflection\\ReflectionSessionTest');
     $this->addTestSuite('\\pdepend\\reflection\\ReflectionSessionInstanceTest');
     $this->addTest(integration\AllTests::suite());
     $this->addTest(regression\AllTests::suite());
 }
开发者ID:naderman,项目名称:pflow,代码行数:21,代码来源:AllTests.php

示例6: suite

 public static function suite()
 {
     PHPUnit_Util_Filter::addDirectoryToWhitelist(DWOO_DIRECTORY . 'plugins/builtin');
     PHPUnit_Util_Filter::addDirectoryToWhitelist(DWOO_DIRECTORY . 'Dwoo');
     PHPUnit_Util_Filter::addFileToWhitelist(DWOO_DIRECTORY . 'Dwoo.php');
     PHPUnit_Util_Filter::removeDirectoryFromWhitelist(DWOO_DIRECTORY . 'Dwoo/Adapters');
     $suite = new self('Dwoo - Unit Tests Report');
     foreach (new DirectoryIterator(dirname(__FILE__)) as $file) {
         if (!$file->isDot() && !$file->isDir() && (string) $file !== 'DwooTests.php' && substr((string) $file, -4) === '.php') {
             require_once $file->getPathname();
             $class = basename($file, '.php');
             // to have an optional test suite, it should implement a public static function isRunnable
             // that returns true only if all the conditions are met to run it successfully, for example
             // it can check that an external library is present
             if (!method_exists($file, 'isRunnable') || call_user_func(array($file, 'isRunnable'))) {
                 $suite->addTestSuite($class);
             }
         }
     }
     return $suite;
 }
开发者ID:apeschar,项目名称:php-fw,代码行数:21,代码来源:DwooTests.php

示例7: suite

 /**
  * look for test units and run them
  */
 public static function suite()
 {
     $testorder = array('CoreTests', 'ClearCompiledTests', 'ClearCacheTests', 'StringResourceTests', 'FileResourceTests', 'DoubleQuotedStringTests', 'CompileAssignTests', 'AttributeTests');
     $smarty_libs_dir = dirname(__FILE__) . '/../../distribution/libs';
     if (method_exists('PHPUnit_Util_Filter', $smarty_libs_dir)) {
         // Older versions of PHPUnit did not have this function,
         // which is used when determining which PHP files are
         // included in the PHPUnit code coverage result.
         PHPUnit_Util_Filter::addDirectoryToWhitelist($smarty_libs_dir);
         PHPUnit_Util_Filter::removeDirectoryFromWhitelist('./');
         // PHPUnit_Util_Filter::addDirectoryToWhitelist('../libs/plugins');
     }
     $suite = new self('Smarty 3 - Unit Tests Report');
     // load test which should run in specific order
     foreach ($testorder as $class) {
         require_once $class . '.php';
         $suite->addTestSuite($class);
     }
     $_classes = array();
     foreach (new DirectoryIterator(dirname(__FILE__)) as $file) {
         if (!$file->isDot() && !$file->isDir() && (string) $file !== 'smartytests.php' && (string) $file !== 'smartytestssingle.php' && (string) $file !== 'smartytestsfile.php' && substr((string) $file, -4) === '.php') {
             $class = basename($file, '.php');
             if (!in_array($class, $testorder)) {
                 require_once $file->getPathname();
                 // to have an optional test suite, it should implement a public static function isRunnable
                 // that returns true only if all the conditions are met to run it successfully, for example
                 // it can check that an external library is present
                 if (!method_exists($class, 'isRunnable') || call_user_func(array($class, 'isRunnable'))) {
                     $_classes[] = $class;
                 }
             }
         }
     }
     sort($_classes);
     foreach ($_classes as $class) {
         $suite->addTestSuite($class);
     }
     return $suite;
 }
开发者ID:jjs180,项目名称:dance-america,代码行数:42,代码来源:smartytests.php

示例8: dirname

 * Copyright 2009, 2010, 2011, 2014 Yuriy Timofeev <tim4dev@gmail.com>
 * @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;
开发者ID:staser,项目名称:webacula,代码行数:31,代码来源:AllTests.php

示例9: foreach

}
if (defined('TESTS_GENERATE_REPORT') && TESTS_GENERATE_REPORT === true && version_compare(PHPUnit_Runner_Version::id(), '3.1.6', '>=')) {
    /*
     * Add Zend Framework library/ directory to the PHPUnit code coverage
     * whitelist. This has the effect that only production code source files
     * appear in the code coverage report and that all production code source
     * files, even those that are not covered by a test yet, are processed.
     */
    PHPUnit_Util_Filter::addDirectoryToWhitelist($zfCoreLibrary);
    /*
     * Add Void library/ directory to the PHPUnit code coverage
     * whitelist. This has the effect that only production code source files
     * appear in the code coverage report and that all production code source
     * files, even those that are not covered by a test yet, are processed.
     */
    PHPUnit_Util_Filter::addDirectoryToWhitelist($voidCoreLibrary);
    /*
     * Omit from code coverage reports the contents of the tests directory
     */
    foreach (array('.php', '.phtml', '.csv', '.inc') as $suffix) {
        PHPUnit_Util_Filter::addDirectoryToFilter($voidCoreTests, $suffix);
    }
    PHPUnit_Util_Filter::addDirectoryToFilter(PEAR_INSTALL_DIR);
    PHPUnit_Util_Filter::addDirectoryToFilter(PHP_LIBDIR);
}
/**
 * Start output buffering, if enabled
 */
if (defined('TESTS_ZEND_OB_ENABLED') && constant('TESTS_ZEND_OB_ENABLED')) {
    ob_start();
}
开发者ID:stm555,项目名称:Void-Library,代码行数:31,代码来源:Bootstrap.php

示例10: date_default_timezone_set

 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 *
 * @category  Zend
 * @package   Zend_Image
 * @author    Stanislav Seletskiy <s.seletskiy@gmail.com>
 * @author    Leonid Shagabutdinov <leonid@shagabutdinov.com>
 * @copyright Copyright (c) 2010
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @version   $Id$
 */
date_default_timezone_set('Asia/Novosibirsk');
error_reporting(E_ALL | E_STRICT);
define('ROOT_PATH', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
define('LIBRARY_PATH', ROOT_PATH . 'library' . DIRECTORY_SEPARATOR);
define('TESTS_PATH', ROOT_PATH . 'tests' . DIRECTORY_SEPARATOR);
set_include_path(implode(PATH_SEPARATOR, array(LIBRARY_PATH, TESTS_PATH, get_include_path())));
/*
 * PHPUnit
 */
require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Framework/IncompleteTestError.php';
require_once 'PHPUnit/Framework/TestCase.php';
require_once 'PHPUnit/Framework/TestSuite.php';
require_once 'PHPUnit/Runner/Version.php';
require_once 'PHPUnit/TextUI/TestRunner.php';
require_once 'PHPUnit/Util/Filter.php';
PHPUnit_Util_Filter::addDirectoryToWhitelist(LIBRARY_PATH);
开发者ID:aecca,项目名称:zend-image,代码行数:30,代码来源:TestHelper.php

示例11: init

 /**
  * Initializes the test environment.
  *
  * @return void
  */
 public static function init()
 {
     // Is it not installed?
     if (is_file(dirname(__FILE__) . '/../../../PHP/Depend.php')) {
         $path = realpath(dirname(__FILE__) . '/../../..');
         $path .= PATH_SEPARATOR . get_include_path();
         set_include_path($path);
         $whitelist = realpath(dirname(__FILE__) . '/../../../PHP') . '/';
         PHPUnit_Util_Filter::addDirectoryToWhitelist($whitelist);
     }
     // Set test path
     $path = realpath(dirname(__FILE__) . '/../..');
     $path .= PATH_SEPARATOR . get_include_path();
     set_include_path($path);
     include_once 'PHP/Depend/Code/Filter/Collection.php';
     self::initVersionCompatibility();
 }
开发者ID:JohnMurray,项目名称:VulnScan,代码行数:22,代码来源:AbstractTest.php

示例12: define

<?php

define('DIR_SF_REPLICA', realpath(dirname(__FILE__) . '/..'));
// Replica
require_once DIR_SF_REPLICA . '/lib/vendor/Replica/include.php';
// Symfony
$sfDir = DIR_SF_REPLICA . '/../../lib/vendor/symfony/lib';
require_once $sfDir . '/config/sfConfig.class.php';
sfConfig::set('sf_symfony_lib_dir', $sfDir);
// Plugin
require_once DIR_SF_REPLICA . '/lib/sfReplicaThumbnail.php';
require_once DIR_SF_REPLICA . '/lib/image/sfReplicaImageDoctrine.php';
require_once DIR_SF_REPLICA . '/lib/helper/ReplicaHelper.php';
// Doctrine
require_once DIR_SF_REPLICA . '/../../lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine.php';
spl_autoload_register(array('Doctrine', 'autoload'));
Doctrine_Manager::connection('mysql://username:password@localhost/test');
// Test
require_once DIR_SF_REPLICA . '/test/sfReplicaThumbnailTestCase.php';
PHPUnit_Util_Filter::addDirectoryToWhitelist(DIR_SF_REPLICA . '/lib');
开发者ID:pycmam,项目名称:sfReplicaThumbnailPlugin,代码行数:20,代码来源:bootstrap.php

示例13: define

<?php

define("TEST_CASE", true);
define("SABEL_BASE", dirname(realpath(__FILE__)));
define("DS", DIRECTORY_SEPARATOR);
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);
开发者ID:hamaco,项目名称:phwittr-on-xoops,代码行数:31,代码来源:SabelAllTests.php

示例14: array

/*
 * Prepend the library/, tests/, and models/ directories to the
 * include_path. This allows the tests to run out of the box.
 */
$path = array($models, $library, $tests, get_include_path());
set_include_path(implode(PATH_SEPARATOR, $path));
/**
 * Register autoloader
 */
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
/*
 * Add library/ and models/ directory to the PHPUnit code coverage
 * whitelist. This has the effect that only production code source files appear
 * in the code coverage report and that all production code source files, even
 * those that are not covered by a test yet, are processed.
 */
if (defined('TESTS_GENERATE_REPORT') && TESTS_GENERATE_REPORT === true && version_compare(PHPUnit_Runner_Version::id(), '3.1.6', '>=')) {
    PHPUnit_Util_Filter::addDirectoryToWhitelist($library);
    PHPUnit_Util_Filter::addDirectoryToWhitelist($models);
    PHPUnit_Util_Filter::addDirectoryToWhitelist($controllers);
}
/**
 * Store application root in registry
 */
Zend_Registry::set('testRoot', $root);
Zend_Registry::set('testBootstrap', $root . '/application/bootstrap.php');
/*
 * Unset global variables that are no longer needed.
 */
unset($root, $library, $models, $controllers, $tests, $path);
开发者ID:jesus12223,项目名称:pastebin,代码行数:31,代码来源:TestHelper.php

示例15: dirname

require_once PHPCB_SOURCE . '/Util/Autoloader.php';
require_once 'PHPUnit/Framework/TestSuite.php';
require_once 'PHPUnit/TextUI/TestRunner.php';
require_once 'PHPUnit/Util/Filter.php';
require_once dirname(__FILE__) . '/src/JSGeneratorTest.php';
require_once dirname(__FILE__) . '/src/HTMLGeneratorTest.php';
require_once dirname(__FILE__) . '/src/ErrorHandlerTest.php';
require_once dirname(__FILE__) . '/src/XMLGeneratorTest.php';
require_once dirname(__FILE__) . '/src/XMLHandlerTest.php';
require_once dirname(__FILE__) . '/src/FDHandlerTest.php';
require_once dirname(__FILE__) . '/src/PluginErrorTest.php';
require_once dirname(__FILE__) . '/src/Plugins/ErrorPMDTest.php';
require_once dirname(__FILE__) . '/src/Plugins/ErrorCPDTest.php';
require_once dirname(__FILE__) . '/src/Plugins/ErrorCheckstyleTest.php';
require_once dirname(__FILE__) . '/src/Plugins/ErrorPadawanTest.php';
PHPUnit_Util_Filter::addDirectoryToWhitelist(realpath(PHPCB_SOURCE));
/**
 * CbAlltests
 *
 * @category   PHP_CodeBrowser
 * @package    PHP_CodeBrowser
 * @subpackage PHPUnit
 * @author     Elger Thiele <elger.thiele@mayflower.de>
 * @copyright  2007-2009 Mayflower GmbH
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: @package_version@
 * @link       http://www.phpunit.de/
 * @since      Class available since 1.0
 */
class CbAllTests extends PHPUnit_Framework_TestSuite
{
开发者ID:shliujing,项目名称:PHP_CodeBrowser,代码行数:31,代码来源:AllTests.php


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