function testdbApplicantScreeningsModule() { //create empty dbApplicantScreenings table //$this->assertTrue(create_dbApplicantScreenings()); // create several applicant screening objects to add to table $screening1 = new ApplicantScreening("guestchef", "Gabrielle1111234567", "complete application,background check,complete interview", "unpublished"); $screening2 = new ApplicantScreening("volunteer", "Jackson6269170632", "complete interview", "published"); $screening3 = new ApplicantScreening("manager", "Jill2075556666", null, null); $screening4 = new ApplicantScreening("socialworker", "Jackson6269170632", null, "unpublished"); $this->assertTrue(insert_dbApplicantScreenings($screening1)); $this->assertTrue(insert_dbApplicantScreenings($screening2)); $this->assertTrue(insert_dbApplicantScreenings($screening3)); $this->assertTrue(insert_dbApplicantScreenings($screening4)); //tests the retrieve function $this->assertEqual(retrieve_dbApplicantScreenings($screening1->get_type())->get_type(), "guestchef"); $this->assertEqual(retrieve_dbApplicantScreenings($screening1->get_type())->get_creator(), "Gabrielle1111234567"); $this->assertEqual(retrieve_dbApplicantScreenings($screening1->get_type())->get_steps(), array("complete application", "background check", "complete interview")); $this->assertEqual(retrieve_dbApplicantScreenings($screening1->get_type())->get_status(), "unpublished"); //tests the update function $screening1->set_status("published"); $this->assertTrue(update_dbApplicantScreenings($screening1)); $this->assertEqual(retrieve_dbApplicantScreenings($screening1->get_type())->get_status(), "published"); // tests get_all function $allscreenings = getall_ApplicantScreenings(); $this->assertTrue($allscreenings); // tests delete function $this->assertTrue(delete_dbApplicantScreenings($screening1->get_type())); $this->assertTrue(delete_dbApplicantScreenings($screening2->get_type())); $this->assertTrue(delete_dbApplicantScreenings($screening3->get_type())); $this->assertTrue(delete_dbApplicantScreenings($screening4->get_type())); echo "testdbApplicantScreenings complete"; }
* shows a form for a screening to be added or edited in the database * @author Jackson Moniaga * @version 4/16/2012 */ if ($_SESSION['access_level'] < 2) { echo "<p id=\"error\">Only managers can view the master schedule.</p>"; include 'footer.inc'; die; } include_once 'database/dbApplicantScreenings.php'; include_once 'domain/ApplicantScreening.php'; echo '<form method="POST">'; if ($action == "select") { echo '<input type="hidden" name = "_form_submit" value="1">'; echo '<p>Type: <select name="s_type">'; $screenings = getall_ApplicantScreenings(); $screeningtypes = []; foreach ($screenings as $s) { $t = $s->get_type(); array_push($screeningtypes, $t); if ($screening->get_type() == $t) { echo '<option value ="' . $t . '" SELECTED>' . $t . '</option>'; } else { echo '<option value ="' . $t . '"> ' . $t . '</option>'; } } if (!in_array("new", $screeningtypes)) { echo '<option value="new">new</option>'; } echo '</select>'; echo '<p>Hit <input type="submit" value="Submit" name="Submit Edits"> to select this screening.<br><br>';