<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Basic tests for User Registration View</title> </head> <body> <h1>Signup Controller test</h1> <?php include_once "../controllers/SignupController.class.php"; include_once "../views/SignupView.class.php"; ?> <h2>It should call the run method for the input from $GET</h2> <?php $_SERVER["REQUEST_METHOD"] = "GET"; $_GET = array("userName" => "Thugnificent", "firstName" => "Otis", "lastName" => "Jenkins", "address" => "123 Thug Lane", "neighborhood" => "Woodcrest", "dateOfBirth" => "11/08/1989", "gender" => "male", "aboutMe" => "I love test cases!", "email" => "*****@*****.**", "phone" => "(210) 555 - 5555", "url" => "https://otis_jenkins/facebook.com"); SignUpController::run(); ?> </body> </html>
<?php include "includer.php"; ###(SECTION) Parse URL $url = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); $urlPieces = split("/", $url); if (count($urlPieces) < 2) { $control = "home"; } else { $control = $urlPieces[2]; } ###(ENDSECTION) Parse URL ###(SECTION) Redirect switch ($control) { case "sign-up": SignUpController::run(null); break; case "log-in": LogInController::run(null); break; case "dashboard": DashboardController::run(null); break; case "profile": ProfileController::run(null); break; case "edit-profile": EditProfileController::run(null); break; case "build-map": MapController::run(null);