* @return array an array with two elements: First, some additional progress output,
* for example a list (<ul>) of the things check each with an one work ok/not ok summary.
* Second, an array giving the details of any problems found. These arrays
- * for all tables will be aggregated, and then passed to
+ * for all tables will be aggregated, and then passed to
*/
abstract protected function check_table(xmldb_table $xmldb_table, array $metacolumns);
we'll return to their official distro.
skodak, iarenaza, moodler, stronk7
-
-$Id$
/**
* Contains Main class and supporting functions for ajax course layout
- *
- * $Id$
*/
* library for ajaxcourse formats, the classes and related functions for drag and drop blocks
*
* this library requires a 'main' object created in calling document
- *
- * $Id$
*/
*
* Dropping an activity or resource on another activity or resource will
* always move the former just above the latter.
- *
- * $Id$
*/
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
-//
-// $Id$
require_once("HTML/QuickForm/button.php");
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
-//
-// $Id$
require_once('HTML/QuickForm/element.php');
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
global $DB, $CFG;
// Insert needed capabilities
- $DB->insert_record('capabilities',
+ $DB->insert_record('capabilities',
array('id' => 45, 'name' => 'moodle/course:update', 'cattype' => 'write', 'contextlevel' => 50, 'component' => 'moodle', 'riskbitmask' => 4));
- $DB->insert_record('capabilities',
+ $DB->insert_record('capabilities',
array('id' => 14, 'name' => 'moodle/site:backup', 'cattype' => 'write', 'contextlevel' => 50, 'component' => 'moodle', 'riskbitmask' => 28));
- $DB->insert_record('capabilities',
+ $DB->insert_record('capabilities',
array('id' => 17, 'name' => 'moodle/site:restore', 'cattype' => 'write', 'contextlevel' => 50, 'component' => 'moodle', 'riskbitmask' => 28));
- $DB->insert_record('capabilities',
+ $DB->insert_record('capabilities',
array('id' => 52, 'name' => 'moodle/course:managefiles', 'cattype' => 'write', 'contextlevel' => 50, 'component' => 'moodle', 'riskbitmask' => 4));
- $DB->insert_record('capabilities',
+ $DB->insert_record('capabilities',
array('id' => 73, 'name' => 'moodle/user:editownprofile', 'cattype' => 'write', 'contextlevel' => 10, 'component' => 'moodle', 'riskbitmask' => 16));
-
+
// Insert system context
$DB->insert_record('context', array('id' => 1, 'contextlevel' => 10, 'instanceid' => 0, 'path' => '/1', 'depth' => 1));
$DB->insert_record('context', array('id' => 2, 'contextlevel' => 50, 'instanceid' => 1, 'path' => '/1/2', 'depth' => 2));
-
+
// Insert site course
$DB->insert_record('course', array('category' => 0, 'sortorder' => 1, 'fullname' => 'Test site', 'shortname' => 'test', 'format' => 'site', 'modinfo' => 'a:0:{}'));
assign_capability('moodle/site:doanything', CAP_ALLOW, $adminrole, $syscontext->id);
update_capabilities('moodle');
update_capabilities('mod_forum');
-
+
$contexts = $this->load_test_data('context',
array('contextlevel', 'instanceid', 'path', 'depth'), array(
1 => array(40, 666, '', 2)));
$this->switch_global_user_id(1);
accesslib_clear_all_caches_for_unit_testing();
-
+
// Create a coursecat
$newcategory = new stdClass();
$newcategory->name = 'test category';
// Create a course
$coursedata = new stdClass();
$coursedata->category = $newcategory->id;
- $coursedata->shortname = 'testcourse';
+ $coursedata->shortname = 'testcourse';
$coursedata->fullname = 'Test Course';
-
+
try {
$this->course = create_course($coursedata);
} catch (moodle_exception $e) {
$module->type = 'general';
$module->forcesubscribe = 1;
$module->format = 1;
- $module->name = 'Test Forum';
+ $module->name = 'Test Forum';
$module->module = $DB->get_field('modules', 'id', array('name' => 'forum'));
$module->modulename = 'forum';
$module->add = 'forum';
$module->course = $this->course->id;
$module->instance = forum_add_instance($module, '');
-
+
$this->section = get_course_section(1, $this->course->id);
$module->section = $this->section->id;
$module->coursemodule = add_course_module($module);
// Update local copy of course
$this->course = $DB->get_record('course', array('id' => $this->course->id));
}
-
+
public function teardown() {
parent::tearDown();
}
-
+
public function createFiles() {
}
public function test_get_children() {
$children = $this->fileinfo->get_children();
$this->assertEqual(2, count($children));
-
+
// Not sure but I think there should be two children: a file_info_stored object and a file_info_course object.
$this->assertEqual('Category introduction', $children[0]->get_visible_name());
$this->assertEqual('', $children[0]->get_url());
$context = get_context_instance(CONTEXT_SYSTEM);
$fis = new file_info_system(new file_browser(), $context);
$parent = $this->fileinfo->get_parent();
- $this->assertEqual($parent, $fis);
+ $this->assertEqual($parent, $fis);
}
}
$this->assertEqual('Backups', $children[2]->get_visible_name());
$this->assertEqual('', $children[2]->get_url());
$this->assertEqual('file_info_stored', get_class($children[2]));
-
+
$this->assertEqual('Course files', $children[3]->get_visible_name());
$this->assertEqual('', $children[3]->get_url());
$this->assertEqual('file_info_coursefile', get_class($children[3]));
$context = get_context_instance(CONTEXT_COURSECAT, $this->coursecat->id);
$fic = new file_info_coursecat(new file_browser(), $context, $this->coursecat);
$parent = $this->fileinfo->get_parent();
- $this->assertEqual($parent, $fic);
+ $this->assertEqual($parent, $fic);
}
}
$context = get_context_instance(CONTEXT_USER, $this->user->id);
$this->fileinfo = new file_info_user(new file_browser(), $context, $this->user);
}
-
+
public function test_get_parent() {
$context = get_context_instance(CONTEXT_SYSTEM);
$fic = new file_info_system(new file_browser(), $context);
$parent = $this->fileinfo->get_parent();
- $this->assertEqual($parent, $fic);
+ $this->assertEqual($parent, $fic);
}
-
+
public function test_get_children() {
$children = $this->fileinfo->get_children();
$this->assertEqual(2, count($children));
-
+
$this->assertEqual('Personal', $children[0]->get_visible_name());
$this->assertEqual('', $children[0]->get_url());
$this->assertEqual('file_info_stored', get_class($children[0]));
-
+
$this->assertEqual('Profile', $children[1]->get_visible_name());
$this->assertEqual('', $children[1]->get_url());
$this->assertEqual('file_info_stored', get_class($children[1]));
$context = get_context_instance(CONTEXT_COURSE, $this->course->id);
$fic = new file_info_course(new file_browser(), $context, $this->course);
$parent = $this->fileinfo->get_parent();
- $this->assertEqual($parent, $fic);
+ $this->assertEqual($parent, $fic);
}
-
+
public function test_get_children() {
$children = $this->fileinfo->get_children();
$this->assertEqual(0, count($children));
Completion system manual test
=============================
-This text file describes a manual process which can be used to check that the
+This text file describes a manual process which can be used to check that the
completion system is working correctly. This does not exercise every possible
element of the completion system but it covers most of the basic parts.
2) Create users 'admin' (as part of install) and 'u1'
3) Set the server debug to 'Developer' so that you spot any warnings etc.
-4) Create course 'CF101' (leave default except pick separate groups) and
+4) Create course 'CF101' (leave default except pick separate groups) and
assign 'u1' as student
admin screens and make sure that 'Student' is included on the list of graded
roles, or there will be an error at this step.]
7) Create 2 groups on the course. Assign u1 to one group.
-
+
Completion settings
-------------------
-1) Visit the course setting screen.
+1) Visit the course setting screen.
CHECK B: The completion controls appear. Completion is enabled.
4) Turn off this setting and save.
4b) Note: At present I have not found a satisfactory way to set a default
- for the config option, so if necessary, please manually tick the 'Student'
- checkbox while on this screen.
+ for the config option, so if necessary, please manually tick the 'Student'
+ checkbox while on this screen.
5) Visit the course setting screen again.
-CHECK D: The completion controls do not appear.
+CHECK D: The completion controls do not appear.
6) Visit the setting screen for 'w'
Completion actions
------------------
-Note: Icons are subject to change, so references to a 'tick' etc might not be
+Note: Icons are subject to change, so references to a 'tick' etc might not be
correct.
1) Log in as u1 and go to CF101.
-CHECK H: A completion tick (unticked) is visible next to 'w'.
+CHECK H: A completion tick (unticked) is visible next to 'w'.
2) Click the completion mark a few times.
CHECK I: Completion toggles successfully.
- 2b) Go to u1's profile settings and turn on/off AJAX then repeat toggling the
+ 2b) Go to u1's profile settings and turn on/off AJAX then repeat toggling the
mark. Leave it ticked.
CHECK I2: Completion still toggles successfully.
3) Visit 'f1' and post 1 message. Return to course home.
-CHECK J: There is no tickmark next to f1. (If examined carefully, the 'not
+CHECK J: There is no tickmark next to f1. (If examined carefully, the 'not
complete' icon should be present.)
-
+
4) Visit 'f1' and post a reply to the message. Return to course home.
CHECK K: There is now a tick next to f1.
CHECK L: There is now a tick next to f2.
-6) Visit 'q1' and attempt the quiz, getting it wrong and submitting answer.
+6) Visit 'q1' and attempt the quiz, getting it wrong and submitting answer.
Return to the home page.
-
+
CHECK M: There is a black 'completed' tick next to q1.
7) Visit 'q1' again and this time get it right. Return to home page.
3) Click on the completion progress link.
-CHECK R:
+CHECK R:
A groups dropdown should show the two groups (and 'all').
The progress table should include all activities for which completion
was set, across the top.
- The progress table should show u1 down the side.
+ The progress table should show u1 down the side.
Tick and X icons should match those shown when logged in as u1.
-
+
4) Choose a group that does not include u1
CHECK S:
- An informational ('no users') message should display instead of the progress
+ An informational ('no users') message should display instead of the progress
table.
-
-5) Choose the group that does include u1
-
+
+5) Choose the group that does include u1
+
CHECK T:
The progress table should show u1 again.
-
+
Backup/restore
--------------
CHECK U:
Completion should appear as it did in the previous version of the course
- ('w','f1','f2' complete, 'q2' complete-fail) except that q1 should show as
+ ('w','f1','f2' complete, 'q2' complete-fail) except that q1 should show as
incomplete.
-
+
<?php
-/* $Id$ */
-
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
)
);
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
/**
* An array of possible user_agent strings.
- *
+ *
* @TODO Complete that list using http://www.pgts.com.au/pgtsj/pgtsj0208c.html
* OR make this test function dynamic by pulling out strings from a server somewhere,
* then testing each of them against the check_browser_version function.
'5.5' => array('Windows 2000' => 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)'),
'6.0' => array('Windows XP SP2' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'),
'7.0' => array('Windows XP SP2' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; YPC 3.0.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)')
- ),
+ ),
'Firefox' => array(
'1.0.6' => array('Windows XP' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6'),
'1.5' => array('Windows XP' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8) Gecko/20051107 Firefox/1.5'),
'Debian Linux' => 'Opera/9.01 (X11; Linux i686; U; en)')
)
);
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
return $destination .'= sprintf("'. $string[$identifier] .'");';
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
}
}
}
-?>
+
array( 5, 'moodle/site:doanything', SYSCONTEXTID, CAP_PREVENT),
array( 6, 'moodle/course:view', SYSCONTEXTID, CAP_PREVENT),
));
-
+
$this->switch_to_test_db();
$this->assert(new ArraysHaveSameValuesExpectation(array(2, 5)), array_keys(get_allowed_switchable_roles()));
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
$this->assertContainsBlocksOfType(array($blockname), $blocks);
}
}
-?>
+
public static $includecoverage = array('lib/completionlib.php');
var $realdb,$realcfg,$realsession,$realuser;
- function setUp() {
+ function setUp() {
global $DB,$CFG,$SESSION,$USER;
$this->realdb=$DB;
$this->realcfg=$CFG;
completion_info::internal_get_grade_state($item,$grade));
}
}
-?>
+
'showavailability'=>1,'availablefrom'=>17,'availableuntil'=>398,'course'=>64));
// no ID
- try {
+ try {
$test=new condition_info($cm);
$this->fail();
} catch(coding_exception $e) {
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
$this->assertTrue($CFG->filterall);
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
"tags that ...</blockquote></p></div>", shorten_text($text));
$text = "some text which shouldn't break there";
- $this->assertEqual("some text which shouldn't ...",
+ $this->assertEqual("some text which shouldn't ...",
shorten_text($text, 31));
- $this->assertEqual("some text which shouldn't ...",
+ $this->assertEqual("some text which shouldn't ...",
shorten_text($text, 30));
-
+
// This case caused a bug up to 1.9.5
$text = "<h3>standard 'break-out' sub groups in TGs?</h3> <<There are several";
$this->assertEqual("<h3>standard 'break-out' sub groups in ...</h3>",
}
-?>
+
$this->node->get('hiddendemo1')->get('hiddendemo2')->helpbutton = 'Here is a help button';
$this->node->get('hiddendemo1')->get('hiddendemo3')->display = false;
}
-
+
public function test___construct() {
global $CFG;
$node = new navigation_node($this->fakeproperties);
protected $coursesections5 = 'a:5:{i:0;O:8:"stdClass":6:{s:7:"section";s:1:"0";s:2:"id";s:2:"14";s:6:"course";s:1:"5";s:7:"summary";N;s:8:"sequence";s:3:"288";s:7:"visible";s:1:"1";}i:1;O:8:"stdClass":6:{s:7:"section";s:1:"1";s:2:"id";s:2:"97";s:6:"course";s:1:"5";s:7:"summary";s:0:"";s:8:"sequence";N;s:7:"visible";s:1:"1";}i:2;O:8:"stdClass":6:{s:7:"section";s:1:"2";s:2:"id";s:2:"98";s:6:"course";s:1:"5";s:7:"summary";s:0:"";s:8:"sequence";N;s:7:"visible";s:1:"1";}i:3;O:8:"stdClass":6:{s:7:"section";s:1:"3";s:2:"id";s:2:"99";s:6:"course";s:1:"5";s:7:"summary";s:0:"";s:8:"sequence";N;s:7:"visible";s:1:"1";}i:4;O:8:"stdClass":6:{s:7:"section";s:1:"4";s:2:"id";s:3:"100";s:6:"course";s:1:"5";s:7:"summary";s:0:"";s:8:"sequence";N;s:7:"visible";s:1:"1";}}';
public static $includecoverage = array('./lib/navigationlib.php');
public static $excludecoverage = array();
-
+
public function setUp() {
$this->cache = new navigation_cache('simpletest_nav');
$this->node = new exposed_global_navigation();
$course->modinfo = $this->modinfo5;
$courses[$i] = $course;
}
-
+
$this->node->add_courses($courses);
$this->assertIsA($this->node->get('cat3')->get(0), 'navigation_node');
$this->assertIsA($this->node->get('cat3')->get(1), 'navigation_node');
$course->numsections = 10;
$course->modinfo = $this->modinfo5;
$coursechildren = $this->node->get_by_path($keys)->children;
-
+
$this->node->get_by_path(array('cat2', 'sub2', '5'))->children = array();
$this->node->exposed_load_course_sections($keys, $course);
if ($node4->get('initcall')) {
$this->assertEqual($node4->get('initcall')->text, 'load_for_section_4');
}
-
+
$node5 = clone($this->mocknode);
$node5->initialise(navigation_node::TYPE_RESOURCE, 5);
$this->assertFalse($node5->get('initcall'));
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
$this->assert(new ArraysHaveSameValuesExpectation($expectedcaps), $actualcaps);
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
require_once($modtest);
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
}
}
}
-?>
+
* rsstest.xml: One valid rss feed.
* md5: 8fd047914863bf9b3a4b1514ec51c32c
* size: 32188
- *
+ *
* If networking/proxy configuration is wrong these tests will fail..
*/
<br />
You can find out all the details on the <a href="http://code.google.com/p/google-highly-open-participation-moodle/">Moodle/GHOP contest site</a>.</p></p>
EOD;
- $this->assertEqual($itemone->get_description(), $description);
+ $this->assertEqual($itemone->get_description(), $description);
// TODO fix this so it uses $CFG by default
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// Exercise SUT.
$this->assertEqual($this->stringmanager->get_list_of_countries(),
array('AU' => 'Aussie', 'GB' => 'Royaume-Uni'));
-
+
// Tear down.
$CFG->allcountrycodes = $oldlist;
}
}
-?>
+
$this->assertEqual("$CFG->wwwroot/admin/report/unittest/$relativeurl1", prepare_url(new moodle_url($relativeurl1)));
$this->assertEqual("$CFG->wwwroot$relativeurl2", prepare_url(new moodle_url($relativeurl2)));
}
-
+
function test_compare_url() {
$url1 = new moodle_url('index.php', array('var1' => 1, 'var2' => 2));
$url2 = new moodle_url('index2.php', array('var1' => 1, 'var2' => 2, 'var3' => 3));
}
}
-?>
+
<?php
-// This file is part of Moodle - http://moodle.org/
-//
+// This file is part of Moodle - http://moodle.org/
+//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
-$Id$
-
GLOSSARY FORMAT PLUGINS
-----------------------