MDL-44725 workshop: correct module generation in unittests (15)
This commit is contained in:
committed by
sam marshall
parent
002ccdcf49
commit
ed2ecd3e35
@@ -45,9 +45,12 @@ class workshopform_numerrors_strategy_testcase extends advanced_testcase {
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$workshop = (object)array('id' => 42, 'strategy' => 'numerrors');
|
||||
$this->workshop = new workshop($workshop, null, null);
|
||||
$this->resetAfterTest();
|
||||
$this->setAdminUser();
|
||||
$course = $this->getDataGenerator()->create_course();
|
||||
$workshop = $this->getDataGenerator()->create_module('workshop', array('strategy' => 'numerrors', 'course' => $course));
|
||||
$cm = get_fast_modinfo($course)->instances['workshop'][$workshop->id];
|
||||
$this->workshop = new workshop($workshop, $cm, $course);
|
||||
$this->strategy = new testable_workshop_numerrors_strategy($this->workshop);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user