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


PHP PHPUnit_Framework_TestSuite::getName方法代码示例

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


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

示例1: getCurrentTestName

 /**
  * Determine the "full" test name (including the suite name if it is set)
  *
  * @param \PHPUnit_Framework_TestCase $test
  * @return string
  */
 private function getCurrentTestName(\PHPUnit_Framework_TestCase $test)
 {
     if (null === $this->currentSuite) {
         return $test->getName(true);
     }
     return $this->currentSuite->getName() . '::' . $test->getName(true);
 }
开发者ID:AydinHassan,项目名称:BetterReflection,代码行数:13,代码来源:TestListener.php

示例2: startTestSuite

 public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
 {
     $this->suiteLevel++;
     $this->currentSuiteName = $suite->getName();
     if ($this->suiteLevel == 1 + $this->rootSuiteNestingLevel) {
         $this->rootSuiteName = $suite->getName();
         $suites = $suite->tests();
         $filtered = $this->filterSuites($suites);
         $suite->setTests($filtered);
     }
 }
开发者ID:padraic,项目名称:phpunit-extensions,代码行数:11,代码来源:FilterListener.php

示例3: startTestSuite

 /**
  * A test suite started.
  *
  * @param  PHPUnit_Framework_TestSuite $suite
  * @since  Method available since Release 2.2.0
  */
 public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
 {
     $this->writeOutput($suite->getName() . "\n");
     $this->resetLength();
     $i = 0;
     while ($i != strlen($suite->getName())) {
         $this->writeOutput("-");
         $i++;
     }
     $this->writeOutput("\n");
     $this->resetLength();
 }
开发者ID:swk,项目名称:bluebox,代码行数:18,代码来源:Text_Printer.php

示例4: endTestSuite

 public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
 {
     $this->printUnlessIgnore($suite->getName(), sprintf(" Finished in %.6fs", $this->totalTime));
     $msgIndex = 1;
     foreach (array_merge($this->errorMessages, $this->failureMessages) as $message) {
         $this->printUnlessIgnore($suite->getName(), "\n\n" . $msgIndex++ . ") " . $message);
     }
     if ($this->errors || $this->failures) {
         $color = "[0;31m";
     } else {
         $color = "[0;32m";
     }
     $results = sprintf("\n\n%s\n%d tests, ? assertions, %d failures, %d errors\n\n", str_repeat('=', 80), $this->tests, $this->failures, $this->errors);
     $this->printUnlessIgnore($suite->getName(), chr(27) . $color . $results . chr(27) . chr(27) . "[0m");
 }
开发者ID:humansky,项目名称:qframe,代码行数:15,代码来源:Listener.php

示例5: __construct

    public function __construct(PHPUnit_Framework_TestSuite $suite, array $groups)
    {
        $groupSuites = array();
        $name        = $suite->getName();

        foreach ($groups as $group) {
            $groupSuites[$group] = new PHPUnit_Framework_TestSuite($name . ' - ' . $group);
            $this->addTest($groupSuites[$group]);
        }

        $tests = new RecursiveIteratorIterator(
          new PHPUnit_Util_TestSuiteIterator($suite),
          RecursiveIteratorIterator::LEAVES_ONLY
        );

        foreach ($tests as $test) {
            if ($test instanceof PHPUnit_Framework_TestCase) {
                $testGroups = PHPUnit_Util_Test::getGroups(
                  get_class($test), $test->getName(FALSE)
                );

                foreach ($groups as $group) {
                    foreach ($testGroups as $testGroup) {
                        if ($group == $testGroup) {
                            $groupSuites[$group]->addTest($test);
                        }
                    }
                }
            }
        }
    }
开发者ID:schwarer2006,项目名称:wikia,代码行数:31,代码来源:GroupTestSuite.php

示例6: startTestSuite

 public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
 {
     $suiteName = $suite->getName();
     if (-1 === $this->state) {
         echo "Testing {$suiteName}\n";
         $this->state = 0;
         if (!class_exists('Doctrine\\Common\\Annotations\\AnnotationRegistry', false) && class_exists('Doctrine\\Common\\Annotations\\AnnotationRegistry')) {
             AnnotationRegistry::registerLoader('class_exists');
         }
         if ($this->skippedFile = getenv('SYMFONY_PHPUNIT_SKIPPED_TESTS')) {
             $this->state = 1;
             if (file_exists($this->skippedFile)) {
                 $this->state = 2;
                 if (!($this->wasSkipped = (require $this->skippedFile))) {
                     echo "All tests already ran successfully.\n";
                     $suite->setTests(array());
                 }
             }
         }
     } elseif (2 === $this->state) {
         $skipped = array();
         foreach ($suite->tests() as $test) {
             if (!$test instanceof \PHPUnit_Framework_TestCase || isset($this->wasSkipped[$suiteName]['*']) || isset($this->wasSkipped[$suiteName][$test->getName()])) {
                 $skipped[] = $test;
             }
         }
         $suite->setTests($skipped);
     }
 }
开发者ID:nquicenob,项目名称:symfony,代码行数:29,代码来源:SymfonyTestsListener.php

示例7: startTestSuite

 public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
 {
     if ($this->maxLength == 0) {
         $iterator = new RecursiveIteratorIterator(new PHPUnit_Util_TestSuiteIterator($suite), RecursiveIteratorIterator::SELF_FIRST);
         foreach ($iterator as $item) {
             if ($item instanceof PHPUnit_Framework_TestSuite) {
                 $name = $item->getName();
                 if ($name == '') {
                     $name = '[No name given]';
                 } else {
                     $name = explode('::', $name);
                     $name = array_pop($name);
                 }
                 $this->maxLength = max($this->maxLength, strlen($name));
                 $item->setName($name);
             }
         }
     }
     if ($this->depth > 0) {
         parent::write("\n");
     }
     if ($this->depth == 1) {
         parent::write("\n");
     }
     parent::write(str_pad(str_repeat('  ', $this->depth++) . $suite->getName() . ': ', 40, ' ', STR_PAD_RIGHT));
 }
开发者ID:naderman,项目名称:ezc-unit-test,代码行数:26,代码来源:printer.php

示例8: __construct

 public function __construct(\PHPUnit_Framework_TestSuite $suite = null)
 {
     if ($suite) {
         $this->suite = $suite;
         $this->setName($suite->getName() . ' with polyfills enabled');
         $this->addTest($suite);
     }
 }
开发者ID:Kyra2778,项目名称:AMR,代码行数:8,代码来源:TestListener.php

示例9: endTestSuite

 public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
 {
     $name = $suite->getName();
     if (!$this->isValidClass($name)) {
         return;
     }
     $this->class->tearDownOnce();
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:8,代码来源:TestListener.php

示例10: isClassTestSuite

 protected function isClassTestSuite(PHPUnit_Framework_TestSuite $suite)
 {
     $suite_name = $suite->getName();
     if (!empty($suite_name) && class_exists($suite_name, false)) {
         return true;
     }
     return false;
 }
开发者ID:kminh,项目名称:bwp-framework,代码行数:8,代码来源:wp-functional-testcase-listener.php

示例11: endTestSuite

 public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
 {
     $this->logger->write('Testsuite ' . $suite->getName() . ' ended.');
     if ($this->tests_ok > 0 || $this->tests_failed > 0) {
         $this->logger->write(' OK: ' . $this->tests_ok . ' Failed: ' . $this->tests_failed);
     }
     $this->tests_ok = 0;
     $this->tests_failed = 0;
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:9,代码来源:SeleniumTestListener.php

示例12: endTestSuite

 public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
 {
     if ($this->cleanStorages() && $this->isShowSuiteWarning()) {
         printf("TestSuite '%s': Did not clean up storages\n", $suite->getName());
     }
     if ($this->cleanFileCache() && $this->isShowSuiteWarning()) {
         printf("TestSuite '%s': Did not clean up file cache\n", $suite->getName());
     }
     if ($this->cleanStrayDataFiles() && $this->isShowSuiteWarning()) {
         printf("TestSuite '%s': Did not clean up data dir\n", $suite->getName());
     }
     if ($this->cleanStrayHooks() && $this->isShowSuiteWarning()) {
         printf("TestSuite '%s': Did not clean up hooks\n", $suite->getName());
     }
     if ($this->cleanProxies() && $this->isShowSuiteWarning()) {
         printf("TestSuite '%s': Did not clean up proxies\n", $suite->getName());
     }
 }
开发者ID:olucao,项目名称:owncloud-core,代码行数:18,代码来源:testcleanuplistener.php

示例13: endTestSuite

 public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
 {
     if ($suite->getName() == 'AllTests') {
         return false;
     }
     $sb = "Testsuite: " . $suite->getName() . "\n";
     $sb .= "Tests run: " . $this->getRunCount();
     $sb .= ", Failures: " . $this->getFailureCount();
     $sb .= ", Errors: " . $this->getErrorCount();
     $sb .= ", Incomplete: " . $this->getIncompleteCount();
     $sb .= ", Skipped: " . $this->getSkippedCount();
     $sb .= ", Time elapsed: " . sprintf('%0.5f', $this->getElapsedTime()) . " s\n";
     if ($this->out != NULL) {
         $this->out->write($sb);
         $this->out->write($this->inner);
     }
     parent::endTestSuite($suite);
 }
开发者ID:namesco,项目名称:phing,代码行数:18,代码来源:PlainPHPUnitResultFormatter.php

示例14: startTestSuite

 public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
 {
     $name = str_replace("_", ".", strtolower($suite->getName()));
     echo "\n";
     echo str_repeat('-', 180);
     echo "\n>>> startTestSuite: " . $name;
     //echo 'starting test suite. First, clearing all test statistics';
     //printf("TestSuite '%s' started.\n", $suite->getName());
 }
开发者ID:ianring,项目名称:phpmusicxml,代码行数:9,代码来源:SimpleTestListener.php

示例15: endTestSuite

 public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
 {
     if (!static::$enableDurationCapture) {
         return;
     }
     if (!class_exists($suite->getName())) {
         return;
     }
     static::$durationByTest[$suite->getName()]['time'] = microtime(true) - static::$durationByTest[$suite->getName()]['time'];
 }
开发者ID:nlegoff,项目名称:Phraseanet,代码行数:10,代码来源:PhraseanetPHPUnitListener.php


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