Exemplo n.º 1
0
 public static function setUpBeforeClass()
 {
     static::get_csv_files();
     static::get_logfilelocation_files();
     static::get_zip_files();
     parent::setUpBeforeClass();
 }
 /**
  * Called before each test function.
  */
 protected function setUp()
 {
     global $DB;
     parent::setUp();
     self::$courseroleid = self::create_test_role();
     $syscontext = context_system::instance();
     self::$systemroleid = self::create_test_role('systemname', 'systemshortname', 'systemdescription', array(CONTEXT_SYSTEM));
     self::$coursecatroleid = self::create_test_role('coursecatname', 'coursecatshortname', 'coursecatdescription', array(CONTEXT_COURSECAT));
     self::$userroleid = self::create_test_role('username', 'usershortname', 'userdescription', array(CONTEXT_USER));
     self::$allcontextroleid = self::create_test_role('allname', 'allshortname', 'alldescription', array(CONTEXT_SYSTEM, CONTEXT_COURSE, CONTEXT_COURSECAT, CONTEXT_USER));
     self::$courseid = self::create_test_course();
     self::$userid = self::create_test_user();
     self::get_csv_files();
     self::get_logfilelocation_files();
     self::get_zip_files();
 }
Exemplo n.º 3
0
 /**
  * Do setup before tests.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->setAdminUser();
     // Create data we need for many test cases.
     self::set_up_category_structure(true);
     set_config('defaultenrol', 1, 'enrol_guest');
     set_config('status', ENROL_INSTANCE_DISABLED, 'enrol_guest');
     set_config('enrol_plugins_enabled', 'manual,guest');
     // New config settings needed for course format refactoring in 2.4.
     set_config('numsections', 15, 'moodlecourse');
     set_config('hiddensections', 0, 'moodlecourse');
     set_config('coursedisplay', 1, 'moodlecourse');
     self::get_csv_files();
     self::get_logfilelocation_files();
     self::get_zip_files();
 }
Exemplo n.º 4
0
 /**
  * Do setup before tests.
  */
 protected function setUp()
 {
     global $CFG;
     // Skip test if ELIS is not installed.
     $elis = file_exists($CFG->dirroot . '/local/elisprogram/lib/setup.php') === true ? true : false;
     if ($elis !== true) {
         $this->markTestSkipped('Test requires ELIS to run.');
     }
     parent::setUp();
 }
 /**
  * Run before each test.
  */
 public function setUp()
 {
     parent::setUp();
     set_config('defaultblocks_override', ' ');
 }