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


PHP PHPUnit_Util_Filter类代码示例

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


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

示例1: __construct

 /**
  * Constructs a new test suite instance.
  */
 public function __construct()
 {
     $this->setName('pFlow::AllTests');
     \PHPUnit_Util_Filter::addDirectoryToWhitelist(realpath(dirname(__FILE__) . '/../src/pFlow'));
     $this->addTestSuite('\\pFlow\\AnalyzerTest');
     $this->addTestSuite('\\pFlow\\CliTest');
 }
开发者ID:naderman,项目名称:pflow,代码行数:10,代码来源:AllTests.php

示例2: process

 /**
  * Classe capable de prendre en charge les suites de test à lancer depuis le point d'entrée
  * test.php
  * Actuellement capable de lancer uniquement les tests relatifs au framework. Par la suite
  * il est souhaitable qu'il puisse prendre en charge le lancement des tests fonctionnels.
  *
  * @param	array	$pParams	Tableau de paramètres
  *
  * @todo être capable de lancer les tests fonctionnels avec ce controller.
  */
 public function process($pParams)
 {
     if (@(include_once 'PHPUnit/Framework.php')) {
         require_once COPIX_PATH . 'tests/CopixTest.class.php';
         require_once COPIX_PATH . 'tests/CopixDBTest.class.php';
         require_once COPIX_PATH . 'tests/CopixTestRunner.class.php';
         require_once COPIX_PATH . 'tests/CopixTestPrinter.class.php';
         require_once COPIX_PATH . 'tests/CopixTestXMLPrinter.class.php';
         // Ignore les fichiers de framework de test
         PHPUnit_Util_Filter::addDirectoryToFilter(dirname(__FILE__));
         PHPUnit_Util_Filter::addDirectoryToFilter(dirname(__FILE__) . '/framework');
         $this->_configFile = isset($pParams['conf']) ? $pParams['conf'] : '../project/config/copix.conf.php';
         if (!isset($_REQUEST['tests'])) {
             $this->testWelcome();
         } else {
             if (!isset($pParams['xml']) || $pParams['xml'] == false) {
                 $options['reportDirectory'] = COPIX_TEMP_PATH;
             }
             $options['xml'] = isset($pParams['xml']) && $pParams['xml'];
             CopixTestRunner::run($this->_getSuite(), $options);
         }
     } else {
         $this->showRequiredPHPUnit();
     }
 }
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:35,代码来源:CopixTestController.class.php

示例3: __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

示例4: addFailure

 /**
  * A failure occurred.
  *
  * @param  PHPUnit_Framework_Test				 $test
  * @param  PHPUnit_Framework_AssertionFailedError $e
  * @param  float								  $time
  */
 public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
 {
     $this->write('fail: ' . $e->getMessage());
     $trace = current(PHPUnit_Util_Filter::getFilteredStacktrace($e, FALSE));
     $this->write('trace: ' . print_r($trace, 1));
     $this->currentTestPass = FALSE;
 }
开发者ID:k-kalashnikov,项目名称:geekcon.local,代码行数:14,代码来源:phpunit_test_listener_plain.php

示例5: __toString

 /**
  * @return string
  */
 public function __toString()
 {
     $string = PHPUnit_Framework_TestFailure::exceptionToString($this);
     if ($trace = PHPUnit_Util_Filter::getFilteredStacktrace($this)) {
         $string .= "\n" . $trace;
     }
     return $string;
 }
开发者ID:ronaldbao,项目名称:phpunit,代码行数:11,代码来源:Exception.php

示例6: suite

 public static function suite()
 {
     PHPUnit_Util_Filter::addFileToFilter(__FILE__);
     $suite = new PHPUnit_Framework_TestSuite('Joeh Framework');
     $suite->addTestSuite('Joeh_Net_CurlTest');
     $suite->addTestSuite('Joeh_Net_Curl_OptionTest');
     return $suite;
 }
开发者ID:rafaelss,项目名称:joeh-curl,代码行数:8,代码来源:AllTests.php

示例7: beforeRunTests

 /**
  * Overwrites beforeRunTests. Initiates coverage-report generation if 
  * $coverage has been set to true (@see setCoverageStatus).
  */
 protected function beforeRunTests()
 {
     if ($this->getCoverageStatus()) {
         // blacklist selected folders from coverage report
         foreach (TestRunner::$coverage_filter_dirs as $dir) {
             PHPUnit_Util_Filter::addDirectoryToFilter(BASE_PATH . '/' . $dir);
         }
         $this->getFrameworkTestResults()->collectCodeCoverageInformation(true);
     }
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:14,代码来源:PhpUnitWrapper_3_4.php

示例8: __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

示例9: failureDescription

 /**
  * Returns the description of the failure
  *
  * The beginning of failure messages is "Failed asserting that" in most
  * cases. This method should return the second part of that sentence.
  *
  * @param mixed $other Evaluated value or object.
  *
  * @return string
  */
 protected function failureDescription($other)
 {
     if ($other !== null) {
         $message = '';
         if ($other instanceof Throwable) {
             $message = '. Message was: "' . $other->getMessage() . '" at' . "\n" . PHPUnit_Util_Filter::getFilteredStacktrace($other);
         }
         return sprintf('exception of type "%s" matches expected exception "%s"%s', get_class($other), $this->className, $message);
     }
     return sprintf('exception of type "%s" is thrown', $this->className);
 }
开发者ID:sebastianbergmann,项目名称:phpunit,代码行数:21,代码来源:Exception.php

示例10: suite

 /**
  * TestSuite
  */
 public static function suite()
 {
     $suite = new PHPUnit_Framework_TestSuite('sfReplicaThumbnailPlugin');
     // Replica tests
     $suite->addTestFile(DIR_SF_REPLICA . '/lib/vendor/Replica/test/AllTests.php');
     PHPUnit_Util_Filter::removeDirectoryFromWhitelist(DIR_SF_REPLICA . '/lib/vendor');
     // Plugin tests
     $runner = new PHPUnit_TextUI_TestRunner(new PHPUnit_Runner_StandardTestSuiteLoader());
     $suite->addTest($runner->getTest(dirname(__FILE__) . '/unit'));
     return $suite;
 }
开发者ID:pycmam,项目名称:sfReplicaThumbnailPlugin,代码行数:14,代码来源:AllTests.php

示例11: formatError

 private function formatError($type, PHPUnit_Framework_Test $test, Exception $e)
 {
     if ($test != null) {
         $this->endTest($test, time());
     }
     $this->inner .= $test->getName() . " " . $type . "\n";
     if ($e !== null) {
         $this->inner .= $e->getMessage() . "\n";
         $this->inner .= PHPUnit_Util_Filter::getFilteredStackTrace($e) . "\n";
     }
 }
开发者ID:nmicht,项目名称:tlalokes-in-acst,代码行数:11,代码来源:PlainPHPUnit3ResultFormatter.php

示例12: handleError

 public static function handleError($level, $message, $file, $line)
 {
     $isFiltered = false;
     if (version_compare(PHPUnit_Runner_Version::id(), '3.5.0') >= 0) {
         $isFiltered = PHP_CodeCoverage::getInstance()->filter()->isFiltered($file, array(), true);
     } else {
         $isFiltered = PHPUnit_Util_Filter::isFiltered($file, true, true);
     }
     if (!$isFiltered) {
         return PHPUnit_Util_ErrorHandler::handleError($level, $message, $file, $line);
     }
 }
开发者ID:RadioCampusFrance,项目名称:airtime,代码行数:12,代码来源:PHPUnitTestRunner.php

示例13: blacklistDirectories

 public function blacklistDirectories()
 {
     $directories = new DirectoryIterator(PROJECT_ROOT . DS . 'modules');
     foreach ($directories as $directory) {
         if (!$directory->isDot() && $directory->isDir()) {
             $path = $directory->getPathname() . DS . '_tests';
             if (is_dir($path)) {
                 PHPUnit_Util_Filter::addDirectoryToFilter($path, '.php');
             }
         }
     }
 }
开发者ID:secteofilandia,项目名称:ieducar,代码行数:12,代码来源:AllTests.php

示例14: prepareMessage

 /**
  * @param \Exception $exception
  * @param string $dataSetName
  * @param mixed $dataSet
  * @return string
  */
 protected function prepareMessage(\Exception $exception, $dataSetName, $dataSet)
 {
     if (!is_string($dataSetName)) {
         $dataSetName = var_export($dataSet, true);
     }
     if ($exception instanceof \PHPUnit_Framework_AssertionFailedError && !$exception instanceof \PHPUnit_Framework_IncompleteTestError && !$exception instanceof \PHPUnit_Framework_SkippedTestError || $this->_options['verbose']) {
         $dataSetName = 'Data set: ' . $dataSetName . PHP_EOL;
     } else {
         $dataSetName = '';
     }
     return $dataSetName . $exception->getMessage() . PHP_EOL . \PHPUnit_Util_Filter::getFilteredStacktrace($exception);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:18,代码来源:AggregateInvoker.php

示例15: suite

 public static function suite()
 {
     PHPUnit_Util_Filter::addDirectoryToFilter(dirname(__FILE__));
     $suite = new PHPUnit_Framework_TestSuite();
     $suite->setName('SimpleDOM');
     foreach (glob(dirname(__FILE__) . '/*.php') as $filepath) {
         $name = basename($filepath, '.php');
         if ($name != 'AllTests') {
             $suite->addTestFile($filepath);
         }
     }
     return $suite;
 }
开发者ID:laiello,项目名称:simpledom,代码行数:13,代码来源:AllTests.php


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