本文整理汇总了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);
}
示例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);
}
}
示例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();
}
示例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");
}
示例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);
}
}
}
}
}
}
示例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);
}
}
示例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));
}
示例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);
}
}
示例9: endTestSuite
public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
{
$name = $suite->getName();
if (!$this->isValidClass($name)) {
return;
}
$this->class->tearDownOnce();
}
示例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;
}
示例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;
}
示例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());
}
}
示例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);
}
示例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());
}
示例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'];
}