PHPUnit_Util_Test::describe PHP Method

describe() public static method

public static describe ( PHPUnit_Framework_Test $test, boolean $asString = true ) : mixed
$test PHPUnit_Framework_Test
$asString boolean
return mixed
    public static function describe(PHPUnit_Framework_Test $test, $asString = true)
    {
        if ($asString) {
            if ($test instanceof PHPUnit_Framework_SelfDescribing) {
                return $test->toString();
            } else {
                return get_class($test);
            }
        } else {
            if ($test instanceof PHPUnit_Framework_TestCase) {
                return [get_class($test), $test->getName()];
            } elseif ($test instanceof PHPUnit_Framework_SelfDescribing) {
                return ['', $test->toString()];
            } else {
                return ['', get_class($test)];
            }
        }
    }

Usage Example

Example #1
0
 /**
  * @return boolean
  */
 public function accept()
 {
     $test = $this->getInnerIterator()->current();
     if ($test instanceof PHPUnit_Framework_TestSuite) {
         return TRUE;
     }
     $tmp = PHPUnit_Util_Test::describe($test, FALSE);
     if ($tmp[0] != '') {
         $name = join('::', $tmp);
     } else {
         $name = $tmp[1];
     }
     return preg_match($this->filter, $name);
 }
All Usage Examples Of PHPUnit_Util_Test::describe