Пример #1
0
 /**
  * Run the actual test
  */
 public function run()
 {
     $class = new \ReflectionClass($this);
     $skip = array('run', 'getTargetDrivers', 'onEvent');
     // Call all methods except run automatically
     foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
         // Skip methods inherited from parent class
         if ($method->class != $class->getName()) {
             continue;
         }
         if (in_array($method->name, $skip)) {
             continue;
         }
         $classname = str_replace($class->getParentClass()->getName() . '_', '', $method->class);
         printtext("\n\t" . $classname . "->" . $method->name . " [" . $method->class . "->" . $method->name . "]" . " \n\t");
         $call = $method->name;
         $this->{$call}();
         try {
             R::nuke();
         } catch (\PDOException $e) {
             // Some tests use a broken database on purpose, so an exception is ok
         }
     }
 }
Пример #2
0
function testpack($name)
{
    printtext("testing: " . $name);
}
Пример #3
0
/**
 * prints out the name of the current test pack.
 *
 * @param string $name name of the test pack
 */
function maintestpack($name)
{
    printtext("\n\nTestpack: " . $name . " \n\t");
}
Пример #4
0
function fail()
{
    printtext("FAILED TEST");
    debug_print_backtrace();
    exit;
}