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


PHP PHPUnit_Framework_TestSuite::addTestFiles方法代码示例

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


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

示例1: suite

 public static function suite()
 {
     $suite = new PHPUnit_Framework_TestSuite('Structures_Graph Tests');
     $dir = new GlobIterator(dirname(__FILE__) . '/*Test.php');
     $suite->addTestFiles($dir);
     return $suite;
 }
开发者ID:crazy-max,项目名称:neard-bin-php,代码行数:7,代码来源:AllTests.php

示例2: suite

 public static function suite()
 {
     $suite = new PHPUnit_Framework_TestSuite('Net_WebFinger tests');
     /** Add testsuites, if there is. */
     $suite->addTestFiles(glob(__DIR__ . '/Net/WebFinger{,/,/*/}*Test.php', GLOB_BRACE));
     return $suite;
 }
开发者ID:mitgedanken,项目名称:Net_WebFinger,代码行数:7,代码来源:AllTests.php

示例3: suite

 /**
  * Adds all class test suites into the master suite
  *
  * @return PHPUnit_Framework_TestSuite a master test suite
  *                                     containing all class test suites
  * @uses PHPUnit_Framework_TestSuite
  */
 public static function suite()
 {
     $suite = new PHPUnit_Framework_TestSuite('PhpDocumentor Full Suite of Unit Tests');
     $dir = new GlobIterator(dirname(__FILE__) . '/*Test.php');
     $suite->addTestFiles($dir);
     return $suite;
 }
开发者ID:wuthering-bytes,项目名称:thrak,代码行数:14,代码来源:AllTests.php

示例4: suite

 static function suite()
 {
     $dir = dirname(__FILE__);
     $suite = new PHPUnit_Framework_TestSuite('chatAll');
     $suite->addTestFiles(array("{$dir}/mysqltest.php", "{$dir}/ControllerBaseTest.php", "{$dir}/TemplateTest.php"));
     return $suite;
 }
开发者ID:BGCX262,项目名称:zxhproject-svn-to-git,代码行数:7,代码来源:all.php

示例5: suite

 /**
  * Test suite for System_Launcher
  * 
  * @return Full test suite
  */
 public static function suite()
 {
     $suite = new PHPUnit_Framework_TestSuite('System_Launcher tests');
     /** Add testsuites, if there are any */
     $suite->addTestFiles(glob(__DIR__ . '/System_LauncherTest.php', GLOB_BRACE));
     return $suite;
 }
开发者ID:pear,项目名称:System_Launcher,代码行数:12,代码来源:AllTests.php

示例6: run

 /**
  * {@inheritdoc}
  */
 public function run(array $argv, $exit = true)
 {
     // Customizing
     // Reset the arguments to the default arguments
     $this->arguments = self::$defaultArguments;
     $this->handleArguments($argv);
     $this->runner->setLoader($this->arguments['loader']);
     $suite = new \PHPUnit_Framework_TestSuite();
     $testFiles = array();
     foreach ($this->arguments['test'] as $testFodler) {
         $testFiles = array_merge($testFiles, self::collectTests($testFodler));
     }
     asort($testFiles);
     $suite->addTestFiles($testFiles);
     unset($this->arguments['test']);
     unset($this->arguments['testFile']);
     try {
         $result = $this->runner->doRun($suite, $this->arguments);
     } catch (\PHPUnit_Framework_Exception $e) {
         print $e->getMessage() . "\n";
     }
     $ret = \PHPUnit_TextUI_TestRunner::FAILURE_EXIT;
     if (isset($result) && $result->wasSuccessful()) {
         $ret = \PHPUnit_TextUI_TestRunner::SUCCESS_EXIT;
     } elseif (!isset($result) || $result->errorCount() > 0) {
         $ret = \PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT;
     }
     if ($exit) {
         exit($ret);
     } else {
         return $ret;
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:36,代码来源:PHPUnitTextUICommand.class.php

示例7: suite

 public static function suite()
 {
     $collector = new PHPUnit_Runner_IncludePathTestCollector(array(dirname(__FILE__)));
     $suite = new PHPUnit_Framework_TestSuite('Application');
     $suite->addTestFiles($collector->collectTests());
     return $suite;
 }
开发者ID:rezaul101,项目名称:erp32,代码行数:7,代码来源:AllTests.php

示例8: suite

 public static function suite()
 {
     $suite = new PHPUnit_Framework_TestSuite('MDB2 Unit Tests');
     $dir = new GlobIterator(__DIR__ . '/Standard/*Test.php');
     $suite->addTestFiles($dir);
     return $suite;
 }
开发者ID:gauthierm,项目名称:MDB2,代码行数:7,代码来源:AllTests.php

示例9: _createSuite

 /**
  * Create test suite
  * 
  * @param  string       $name     Suite name
  * @param  array|string $paths    Paths
  * @param  array|string $suffixes Suffixes
  * @param  array|string $prefixes Prefixes
  * @param  array        $exclude  Exclude
  * 
  * @return AppendIterator
  */
 protected static function _createSuite($name, $paths, $suffixes = '_test.php', $prefixes = '', $exclude = array())
 {
     $factory = new File_Iterator_Factory();
     $iterator = $factory->getFileIterator($paths, $suffixes, $prefixes, $exclude);
     $suite = new PHPUnit_Framework_TestSuite($name);
     $suite->addTestFiles($iterator);
     return $suite;
 }
开发者ID:covex-nn,项目名称:moodle-automation,代码行数:19,代码来源:AllTests.php

示例10: suite

 public static function suite()
 {
     $suite = new \PHPUnit_Framework_TestSuite();
     $files = glob(__DIR__ . '/*/*/*Test.php');
     if (!is_array($files)) {
         return $suite;
     }
     $suite->addTestFiles($files);
     return $suite;
 }
开发者ID:sea75300,项目名称:fanpresscm3,代码行数:10,代码来源:fpcmTests.php

示例11: suite

 public static function suite()
 {
     $types = array('common', 'auth', 'io', 'model', 'providers', 'service', 'storage', 'logger');
     $suite = new PHPUnit_Framework_TestSuite();
     $suite->setName('OfflineTests');
     $path = realpath(dirname(__FILE__));
     foreach ($types as $type) {
         $suite->addTestFiles(glob("{$path}/{$type}/*Test.php"));
     }
     return $suite;
 }
开发者ID:serrg1994,项目名称:opensocial-php-client,代码行数:11,代码来源:OfflineTests.php

示例12: getTest

 /**
  * Returns the Test corresponding to the given suite.
  * This is a template method, subclasses override
  * the runFailed() and clearStatus() methods.
  *
  * @param  string  $suiteClassName
  * @param  string  $suiteClassFile
  * @param  mixed   $suffixes
  * @return PHPUnit_Framework_Test
  */
 public function getTest($suiteClassName, $suiteClassFile = '', $suffixes = '')
 {
     if (is_dir($suiteClassName) && !is_file($suiteClassName . '.php') && empty($suiteClassFile)) {
         $facade = new File_Iterator_Facade();
         $files = $facade->getFilesAsArray($suiteClassName, $suffixes);
         $suite = new PHPUnit_Framework_TestSuite($suiteClassName);
         $suite->addTestFiles($files);
         return $suite;
     }
     $testClass = $this->loadSuiteClass($suiteClassName, $suiteClassFile);
 }
开发者ID:razielsd,项目名称:parallel-phpunit2,代码行数:21,代码来源:BaseTestRunner.php

示例13: suite

 public static function suite()
 {
     global $configuration, $plugin_configuration;
     $suite = new PHPUnit_Framework_TestSuite('sfImageTransformExtraPlugin');
     // loading plugin configurations
     $configuration = ProjectConfiguration::getActive();
     $pluginConfig = $configuration->getPluginConfiguration('sfImageTransformExtraPlugin');
     // instantiate a fake symfony unit test task to retrieve all connected tests for this plugin
     $task = new sfTestUnitTask($configuration->getEventDispatcher(), new sfFormatter());
     $event = new sfEvent($task, 'task.test.filter_test_files', array('arguments' => array('name' => array()), 'options' => array()));
     $files = $pluginConfig->filterTestFiles($event, array());
     $suite->addTestFiles($files);
     return $suite;
 }
开发者ID:robo47,项目名称:sfImageTransformExtraPlugin,代码行数:14,代码来源:sfImageTransformExtraPluginTests.php

示例14: run

 public function run(rex_test_locator $locator, $colors = false)
 {
     $suite = new PHPUnit_Framework_TestSuite();
     // disable backup of globals, since we have some rex_sql objectes referenced from variables in global space.
     // PDOStatements are not allowed to be serialized
     $suite->setBackupGlobals(false);
     $suite->addTestFiles($locator->getIterator());
     rex_error_handler::unregister();
     $runner = new PHPUnit_TextUI_TestRunner();
     $backtrace = debug_backtrace(false);
     array_unshift($backtrace, ['file' => __FILE__, 'line' => __LINE__ + 3]);
     $runner->setPrinter(new rex_tests_result_printer($backtrace, $colors));
     $result = $runner->doRun($suite);
     rex_error_handler::register();
     return $result;
 }
开发者ID:staabm,项目名称:redaxo,代码行数:16,代码来源:test_runner.php

示例15: getTest

 /**
  * Returns the Test corresponding to the given suite.
  * This is a template method, subclasses override
  * the runFailed() and clearStatus() methods.
  *
  * @param string $suiteClassName
  * @param string $suiteClassFile
  * @param mixed  $suffixes
  *
  * @return PHPUnit_Framework_Test
  */
 public function getTest($suiteClassName, $suiteClassFile = '', $suffixes = '')
 {
     if (is_dir($suiteClassName) && !is_file($suiteClassName . '.php') && empty($suiteClassFile)) {
         $facade = new File_Iterator_Facade();
         $files = $facade->getFilesAsArray($suiteClassName, $suffixes);
         $suite = new PHPUnit_Framework_TestSuite($suiteClassName);
         $suite->addTestFiles($files);
         return $suite;
     }
     try {
         $testClass = $this->loadSuiteClass($suiteClassName, $suiteClassFile);
     } catch (PHPUnit_Framework_Exception $e) {
         $this->runFailed($e->getMessage());
         return;
     }
     try {
         $suiteMethod = $testClass->getMethod(self::SUITE_METHODNAME);
         if (!$suiteMethod->isStatic()) {
             $this->runFailed('suite() method must be static.');
             return;
         }
         try {
             $test = $suiteMethod->invoke(null, $testClass->getName());
         } catch (ReflectionException $e) {
             $this->runFailed(sprintf("Failed to invoke suite() method.\n%s", $e->getMessage()));
             return;
         }
     } catch (ReflectionException $e) {
         try {
             $test = new PHPUnit_Framework_TestSuite($testClass);
         } catch (PHPUnit_Framework_Exception $e) {
             $test = new PHPUnit_Framework_TestSuite();
             $test->setName($suiteClassName);
         }
     }
     $this->clearStatus();
     return $test;
 }
开发者ID:Ceciceciceci,项目名称:MySJSU-Class-Registration,代码行数:49,代码来源:BaseTestRunner.php


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