本文整理汇总了PHP中stdClass::new_submission_empty方法的典型用法代码示例。如果您正苦于以下问题:PHP stdClass::new_submission_empty方法的具体用法?PHP stdClass::new_submission_empty怎么用?PHP stdClass::new_submission_empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stdClass
的用法示例。
在下文中一共展示了stdClass::new_submission_empty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_new_submission_empty
/**
* Test new_submission_empty
*
* @dataProvider submission_is_empty_testcases
* @param string $submissiontext The file submission data
* @param bool $expected The expected return value
*/
public function test_new_submission_empty($submissiontext, $expected)
{
$this->resetAfterTest();
$data = new stdClass();
$data->onlinetext_editor = ['text' => $submissiontext];
$result = $this->assign->new_submission_empty($data);
$this->assertTrue($result === $expected);
}
示例2: test_new_submission_empty
/**
* Test new_submission_empty
*
* @dataProvider submission_is_empty_testcases
* @param string $data The file submission data
* @param bool $expected The expected return value
*/
public function test_new_submission_empty($data, $expected)
{
$this->resetAfterTest();
$itemid = file_get_unused_draft_itemid();
$submission = (object) ['files_filemanager' => $itemid];
if ($data) {
$data += ['contextid' => context_user::instance($this->user->id)->id, 'itemid' => $itemid];
$fs = get_file_storage();
$fs->create_file_from_string((object) $data, 'Content of ' . $data['filename']);
}
$result = $this->assign->new_submission_empty($submission);
$this->assertTrue($result === $expected);
}