本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}