RedUNIT\RedUNIT::run PHP Method

run() public method

Runs the test. This method will run the tests implemented by the RedUNIT instance. The run method scans its class for all public instance methods except: run (to avoid recursion), getTargetDrivers, onEvent and prepare. -- added cleanUp/prepare just in case they get overridden.
public run ( ) : void
return void
    public function run()
    {
        $class = new \ReflectionClass($this);
        $skip = array('run', 'getTargetDrivers', 'onEvent', 'cleanUp', 'prepare');
        // 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
            }
        }
    }