MDL-55091 phpunit: Following has been deprecated.

1. getMock()
2. setExpectedException()
3. checkForUnintentionallyCoveredCode renamed to beStrictAboutCoversAnnotation
4. beStrictAboutTestSize renamed to enforceTimeLimit
5. UnitTestCase class is now fully removed.
This commit is contained in:
Rajesh Taneja
2016-07-26 10:11:30 +08:00
parent 165b70a16a
commit 52f3e060e4
80 changed files with 806 additions and 560 deletions
@@ -39,31 +39,40 @@ require_once(__DIR__ . '/../behaviour.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_missing_test extends advanced_testcase {
/**
* @expectedException moodle_exception
*/
public function test_missing_cannot_start() {
$qa = new question_attempt(test_question_maker::make_question('truefalse', 'true'), 0);
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
$this->setExpectedException('moodle_exception');
$behaviour->init_first_step(new question_attempt_step(array()), 1);
}
/**
* @expectedException moodle_exception
*/
public function test_missing_cannot_process() {
$qa = new question_attempt(test_question_maker::make_question('truefalse', 'true'), 0);
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
$this->setExpectedException('moodle_exception');
$behaviour->process_action(new question_attempt_pending_step(array()));
}
/**
* @expectedException moodle_exception
*/
public function test_missing_cannot_get_min_fraction() {
$qa = new question_attempt(test_question_maker::make_question('truefalse', 'true'), 0);
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
$this->setExpectedException('moodle_exception');
$behaviour->get_min_fraction();
}
/**
* @expectedException moodle_exception
*/
public function test_missing_cannot_get_max_fraction() {
$qa = new question_attempt(test_question_maker::make_question('truefalse', 'true'), 0);
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
$this->setExpectedException('moodle_exception');
$behaviour->get_max_fraction();
}