public static function updateSubmission()
 {
     // Process updating submissions
     $submissions = SubmissionsDB::getSubmissionsBy('submissionId', $_SESSION['arguments']);
     if (empty($submissions)) {
         HomeView::show();
         header('Location: /' . $_SESSION['base']);
     } elseif ($_SERVER["REQUEST_METHOD"] == "GET") {
         $_SESSION['submissions'] = $submissions;
         SubmissionView::showUpdate();
     } else {
         $parms = $submissions[0]->getParameters();
         $parms['submissionFile'] = array_key_exists('submissionFile', $_POST) ? $_POST['submissionFile'] : "";
         $newSubmission = new Submission($parms);
         $newSubmission->setSubmissionId($submissions[0]->getSubmissionId());
         $submission = SubmissionsDB::updateSubmission($newSubmission);
         if ($submission->getErrorCount() != 0) {
             $_SESSION['submissions'] = array($newSubmission);
             SubmissionView::showUpdate();
         } else {
             HomeView::show();
             header('Location: /' . $_SESSION['base']);
         }
     }
 }
 public function testUpdateSubmission()
 {
     $myDb = DBMaker::create('ptest');
     Database::clearDB();
     $db = Database::getDB('ptest', 'C:\\xampp\\myConfig.ini');
     $beforeCount = count(SubmissionsDB::getSubmissionsBy());
     $submissions = SubmissionsDB::getSubmissionsBy('submissionId', 1);
     $currentSubmission = $submissions[0];
     $parms = $currentSubmission->getParameters();
     $parms['submissionFile'] = 'newFile.txt';
     $newSubmission = new Submission($parms);
     $newSubmission->setSubmissionId($currentSubmission->getSubmissionId());
     $updatedSubmission = SubmissionsDB::updateSubmission($newSubmission);
     $afterCount = count(SubmissionsDB::getSubmissionsBy());
     $this->assertEquals($beforeCount, $afterCount, 'The number of submission in the database should not change after update');
     $this->assertEquals($updatedSubmission->getSubmissionId(), $newSubmission->getSubmissionId(), 'The id of the updated submission should remain the same');
 }