本文整理汇总了PHP中Submission::getErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP Submission::getErrors方法的具体用法?PHP Submission::getErrors怎么用?PHP Submission::getErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Submission
的用法示例。
在下文中一共展示了Submission::getErrors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
foreach ($submissions as $submission) {
echo "{$submission} <br>";
}
?>
<h2>It should insert a valid submission in the database</h2>
<?php
DBMaker::create('ptest');
Database::clearDB();
$db = Database::getDB('ptest', 'C:\\xampp\\myConfig.ini');
$beforeCount = count(SubmissionsDB::getSubmissionsBy());
$validTest = array("submitterName" => "Kay", "assignmentNumber" => "8", "submissionFile" => "V:\test.txt");
$s1 = new Submission($validTest);
echo "<br>In insertion should not have errors {$s1}<br>";
print_r($s1->getErrors());
$newS1 = SubmissionsDB::addSubmission($s1);
$afterCount = count(SubmissionsDB::getSubmissionsBy());
echo 'The inserted submission Id is:' . $newS1->getSubmissionId() . '<br>';
echo "Before the database has {$beforeCount}";
echo "Now the database has {$afterCount}";
?>
<h2>It should not allow insertion of a duplicate submission</h2>
<?php
DBMaker::create('ptest');
Database::clearDB();
$db = Database::getDB('ptest', 'C:\\xampp\\myConfig.ini');
$beforeCount = count(SubmissionsDB::getSubmissionsBy());
$duplicateTest = array("submitterName" => "Kay", "assignmentNumber" => "1", "submissionFile" => "V:\test.txt");
$s1 = new Submission($duplicateTest);