本文整理汇总了PHP中Submission::getErrorCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Submission::getErrorCount方法的具体用法?PHP Submission::getErrorCount怎么用?PHP Submission::getErrorCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Submission
的用法示例。
在下文中一共展示了Submission::getErrorCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public static function run()
{
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$new_post = $_POST;
if (isset($_FILES["submissionFile"])) {
$new_post["submissionFile"] = $_FILES["submissionFile"];
}
$submission = new Submission($new_post);
if ($submission->getErrorCount() != 0) {
SubmissionView::show($submission);
} else {
$user = UsersDB::getUserBy('userName', $submission->getUserName());
if ($user != null) {
HomeView::show($user);
} else {
$submission->setError('userName', 'USER_NAME_DOES_NOT_EXIST');
SubmissionView::show($submission);
}
}
} else {
// Initial link
SubmissionView::show(null);
}
}
示例2: testInvalidNoSubmissionFileName
public function testInvalidNoSubmissionFileName()
{
$invalidTest = array("userName" => "krobbins", "assignmentNumber" => "1");
$s1 = new Submission($invalidTest);
$this->assertGreaterThan(0, $s1->getErrorCount(), 'It should have an error if the submission upload was not correct');
}