protected function setUp()
 {
     parent::setUp();
     $this->testpage = new moodle_page();
     $this->testpage->set_context(get_context_instance(CONTEXT_SYSTEM));
     $this->blockmanager = new testable_block_manager($this->testpage);
 }
Esempio n. 2
0
 protected function setUp()
 {
     global $PAGE;
     parent::setUp();
     $this->renderer = $PAGE->get_renderer('qbehaviour_adaptive');
     $this->options = new question_display_options();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->testpage = new moodle_page();
     $this->testpage->set_context(context_system::instance());
     $this->testpage->set_pagetype('phpunit-block-test');
     $this->blockmanager = new testable_block_manager($this->testpage);
 }
Esempio n. 4
0
 /**
  * Initalize test wide variable, it is called in start of the testcase
  */
 protected function setUp()
 {
     parent::setUp();
     // Get form data.
     $form = new temp_form_duration();
     $this->mform = $form->getform();
     $this->element = $this->mform->addElement('duration', 'duration');
 }
 /**
  * Initalize test wide variable, it is called in start of the testcase
  */
 protected function setUp()
 {
     parent::setUp();
     // Get form data.
     $form = new temp_form_date();
     $this->mform = $form->getform();
     // Set test values.
     $this->testvals = array(array('day' => 1, 'month' => 7, 'year' => 2011, 'usertimezone' => 'America/Moncton', 'timezone' => 'America/Moncton', 'timestamp' => 1309489200), array('day' => 1, 'month' => 7, 'year' => 2011, 'usertimezone' => 'America/Moncton', 'timezone' => 99, 'timestamp' => 1309489200), array('day' => 30, 'month' => 6, 'year' => 2011, 'usertimezone' => 'America/Moncton', 'timezone' => -4, 'timestamp' => 1309406400), array('day' => 30, 'month' => 6, 'year' => 2011, 'usertimezone' => -4, 'timezone' => 99, 'timestamp' => 1309406400), array('day' => 1, 'month' => 7, 'year' => 2011, 'usertimezone' => 0.0, 'timezone' => 0.0, 'timestamp' => 1309478400), array('day' => 1, 'month' => 7, 'year' => 2011, 'usertimezone' => 0.0, 'timezone' => 99, 'timestamp' => 1309478400));
 }
Esempio n. 6
0
 protected function setUp()
 {
     parent::setUp();
     if ($this->getName() === 'test_setup_assert') {
         $this->assertTrue(true);
         $this->testassertexecuted = true;
         return;
     }
 }
Esempio n. 7
0
 /**
  * Setup testing environment
  */
 protected function setUp()
 {
     parent::setUp();
     $cm = new stdclass();
     $course = new stdclass();
     $context = new stdclass();
     $workshop = (object) array('id' => 42, 'evaluation' => 'best');
     $this->workshop = new workshop($workshop, $cm, $course, $context);
     $this->evaluator = new testable_workshop_best_evaluation($this->workshop);
 }
Esempio n. 8
0
 protected function setUp()
 {
     parent::setUp();
     $cm = new stdclass();
     $course = new stdclass();
     $context = new stdclass();
     $workshop = (object) array('id' => 42);
     $this->workshop = new workshop($workshop, $cm, $course, $context);
     $this->allocator = new testable_workshop_random_allocator($this->workshop);
 }
Esempio n. 9
0
 /**
  * Prepares things for this test case.
  */
 protected function setUp()
 {
     global $SESSION;
     if (isset($SESSION->lang)) {
         $this->initiallang = $SESSION->lang;
     }
     $SESSION->lang = 'en';
     // Make sure we test en language to get consistent results, hopefully all systems have this locale.
     if (extension_loaded('intl')) {
         $this->error = 'Collation aware sorting not supported';
     } else {
         $this->error = 'Collation aware sorting not supported, PHP extension "intl" is not available.';
     }
     parent::setUp();
 }
 protected function setUp()
 {
     global $DB, $CFG, $SESSION, $USER;
     parent::setUp();
     $this->realdb = $DB;
     $this->realcfg = $CFG;
     $this->realsession = $SESSION;
     $this->prevuser = $USER;
     $DB = $this->getMock(get_class($DB));
     $CFG = clone $this->realcfg;
     $CFG->prefix = 'test_';
     $CFG->enablecompletion = COMPLETION_ENABLED;
     $SESSION = new stdClass();
     $USER = (object) array('id' => 314159);
 }
Esempio n. 11
0
 public function setUp()
 {
     parent::setUp();
     $this->behaviourtype = question_engine::get_behaviour_type('informationitem');
 }
Esempio n. 12
0
    protected function setUp() {
        parent::setUp();

        $this->cache = new navigation_cache('simpletest_nav');
        $this->cache->anysetvariable = true;
    }
Esempio n. 13
0
 /**
  * Initalize test wide variable, it is called in start of the testcase
  */
 protected function setUp()
 {
     parent::setUp();
     $this->element = new MoodleQuickForm_duration();
 }
Esempio n. 14
0
 /**
  * Sets up the test cases.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->filter = new filter_oembed(context_system::instance(), array());
 }
Esempio n. 15
0
 public function setUp()
 {
     parent::setUp();
     $this->behaviourtype = question_engine::get_behaviour_type('missing');
 }
Esempio n. 16
0
 public function setUp()
 {
     parent::setUp();
     $this->behaviourtype = question_engine::get_behaviour_type('immediatefeedback');
 }
Esempio n. 17
0
 public function setUp()
 {
     parent::setUp();
     $this->behaviourtype = question_engine::get_behaviour_type('interactivecountback');
 }
Esempio n. 18
0
 public function setUp()
 {
     parent::setUp();
     $this->behaviourtype = question_engine::get_behaviour_type('manualgraded');
 }