public function testCallRunFromGet() { DBMaker::create('ptest1'); Database::clearDB(); $db = Database::getDB($dbName = 'ptest1', $configPath = "C:" . DIRECTORY_SEPARATOR . "xampp" . DIRECTORY_SEPARATOR . "myConfig.ini"); $_SERVER["REQUEST_METHOD"] = "GET"; ob_start(); ReviewController::run(); $output = ob_get_clean(); $this->assertFalse(empty($output), "It should show something from a GET"); }
<!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Basic tests for Login Controller</title> </head> <body> <h1>Login controller tests</h1> <?php include_once "../controllers/ReviewController.class.php"; include_once "../views/ReviewView.class.php"; ?> <h2>It should call the run method</h2> <?php //$_SERVER ["REQUEST_METHOD"] = "POST"; //$_POST = array("firstName" => "Kay"); ReviewController::run(); ?> </body> </html>