mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-52813 mod_quiz: New Web Service mod_quiz_get_attempt_data
This commit is contained in:
parent
1d57e4fea5
commit
bc247b0dee
4 changed files with 255 additions and 1 deletions
|
@ -702,4 +702,21 @@ class mod_quiz_external_testcase extends externallib_advanced_testcase {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get_attempt_data
|
||||
*/
|
||||
public function test_get_attempt_data() {
|
||||
|
||||
$result = mod_quiz_external::get_attempt_data();
|
||||
$result = external_api::clean_returnvalue(mod_quiz_external::get_attempt_data_returns(), $result);
|
||||
|
||||
try {
|
||||
mod_quiz_external::get_attempt_data();
|
||||
$this->fail('Exception expected due to missing capability.');
|
||||
} catch (required_capability_exception $e) {
|
||||
$this->assertEquals('nopermissions', $e->errorcode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue