Esempio n. 1
0
 public static function getTestAsString(\PHPUnit_Framework_SelfDescribing $testCase)
 {
     if ($testCase instanceof Descriptive) {
         return $testCase->toString();
     }
     if ($testCase instanceof \PHPUnit_Framework_TestCase) {
         $text = $testCase->getName();
         $text = preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\1 \\2', $text);
         $text = preg_replace('/([a-z\\d])([A-Z])/', '\\1 \\2', $text);
         $text = preg_replace('/^test /', '', $text);
         $text = ucfirst(strtolower($text));
         $text = str_replace(['::', 'with data set'], [':', '|'], $text);
         return ReflectionHelper::getClassShortName($testCase) . ': ' . $text;
     }
     return $testCase->toString();
 }
Esempio n. 2
0
 public function toString()
 {
     return sprintf('%s: %s', ReflectionHelper::getClassShortName($this->getTestClass()), ucfirst($this->getFeature()));
 }