Commit graph

45 commits

Author SHA1 Message Date
Tim Hunt
652599ecc3 MDL-25720 moodlelib new PARAM_RAW_TRIMMED.
Will be required by the new question engine.
2010-12-22 10:51:48 +00:00
Petr Skoda
2168425a9e MDL-25611 more browser detection cleanup and improvements
general WebKit support, adding version support for android, fixing android browser name (engine name first), adding more tests
2010-12-08 07:39:58 +00:00
Petr Skoda
0667103514 MDL-25611 browser detection cleanup and improvements 2010-12-08 06:51:54 +00:00
Sam Marshall
c3097e1333 Unit tests MDL-24978 Fixed locale dependency 2010-11-01 12:11:41 +00:00
Petr Skoda
39461de329 MDL-24837 improved user preferences internal implementation, general code cleanup, minor bugfixing, fixed '0' value regression and improved caching options in cron scripts (this should hopefully help with messaging performance in cron once it is used there), implemented basic unit tests for user user preferences 2010-10-25 20:44:32 +00:00
David Mudrak
8dfb8a0343 MDL-24627 Unknown components are considered activity modules even if their name contains underscore 2010-10-12 12:56:59 +00:00
David Mudrak
e54c41da0b Improved moodlelib_test to illustrate wrong style of writing unit tests
Sorry for this irritating commit but I believe it is the most effective
way how to demonstrate the issue.
2010-10-12 12:56:41 +00:00
Petr Skoda
fb59f2f126 MDL-23184 CLEAN_PARAM explanation improved in unittests 2010-09-02 18:12:21 +00:00
Petr Skoda
b6059edcac MDL-22959 PARA_TEXT multilang whitelisting cleanup; the text is no longer being processed by kses or htmlpurifier - this should fix some recent regressions, any xhtml strict tweaking should be done in format_string() if necessary; unit tests included 2010-09-02 17:30:00 +00:00
Petr Skoda
389d17f9cc MDL-23985 removing all make_user_dir() and get_user_directories() usage 2010-08-29 09:50:36 +00:00
Petr Skoda
04b32359bf MDL-23979 PARAM_CLEAN should not be used in new code at all ,there is nothing like universal cleaning, sorry 2010-08-28 12:25:14 +00:00
Tim Hunt
14f3ad159d moodlelib MDL-19418 fix bugs introduced when converting clean_param to preg.
Aumusingly, one of the bugs was detected by a unit test that was in Moodle 1.9, but
which for some reason was not in HEAD. I have tidied up the clean_param unit tests
and added a few more.
2010-05-12 12:05:59 +00:00
David Mudrak
fe6a248f5a MDL-22015 String identifiers are now validated, coding exception thrown otherwise 2010-04-28 00:06:43 +00:00
Andrew Davis
11cca21ec3 unit tests MDL-22017 made test_usergetdate() work on machines in different timezones 2010-04-16 07:47:39 +00:00
Rossiani Wijaya
34d2b19a15 MDL-16919 - Convert uppercase to lowercase for param_username and updating test result in testmoodlelib. 2010-01-14 07:18:06 +00:00
Rossiani Wijaya
07ed083e4e MDL-16919 - Allow username to contain alphanumeric lowercase characters, underscore (_), hyphen (-), period (.) or at symbol (@) 2010-01-13 06:23:54 +00:00
Andrew Davis
24d38a6e6d moodlelib MDL-20918 usergetdate was returning an array in a different order depending on whether or not timezone was set 2010-01-08 06:56:29 +00:00
Andrew Davis
1fca8fa5fc lib MDL-20537 Added another unit test for shorten_text 2009-11-24 08:07:41 +00:00
Moodle HQ git importer
8926f8449f Fixing drift between CVS and git 2009-11-02 00:32:03 +00:00
sam_marshall
9467db390c MDL-20537: shorten-text fix 2009-10-19 17:13:50 +00:00
skodak
a3f7cbf64e MDL-20293 strict param validation support 2009-09-15 20:08:47 +00:00
skodak
622365d2e1 MDL-20169 fixed coding style, parameter type required 2009-08-27 18:37:53 +00:00
tjhunt
4bea5e8582 moodlellib: MDL-19828 PARAM_LOCALURL should accept URLs like course/view.php?id=2 2009-07-15 06:17:39 +00:00
stronk7
081a63a9eb MDL-19579 code coverage - add more initial $includecoverage attributes 2009-06-26 17:49:15 +00:00
stronk7
db3a1eb8fd MDL-19579 code coverage - prepare ddl & moodlelib tests to support code coverage 2009-06-23 09:30:59 +00:00
tjhunt
89fbdca300 moodle_page: MDL-14305 (and MDL-12212) class on body based on ->wwwroot 2009-05-06 08:44:58 +00:00
tjhunt
bb45fe62c4 get_string: Refactoring, performance improvements, bug fixes and unit tests
MDL-18669 get_string refactored to elimiate duplicate code and make it easier to understand.
MDL-17763 parent language not processed correctly when getting a plugin string.
MDL-16181 more intelligent caching to avoid repeated file_exists checks.
MDL-12434 move values to array keys to improve lookup times.

The main part of the refactoring is to create a singleton string_manager class to encapsulate the cached data and the processing, while breaking the code up into more smaller methods.

Other performance improvements include:
* Cache results of plugin name -> locations to search array.
* Cache parent lang lookup.
* Skip eval if the string does not contain $ \ or %.
* Remove the unnecessary sprintf from the eval.

There is a performance testing script in lib/simpletest/getstringperformancetester.php. For now this script has the old get_string implementation copied and pasted to the end, and renamed to old_get_string to allow for comparitive timings.

There are now some unit tests for get_string in lib/simpletest/teststringmanager.php. I think I have managed to cover most of the tricky cases.
2009-03-30 02:21:27 +00:00
nicolasconnault
ec0123208d MDL-18188 Added a new function with matching unit tests, following Sam's comment in the tracker 2009-02-10 15:33:25 +00:00
skodak
cc4245a3cd MDL-16483 - stopped using MoodleUnitTestCase in tests where $DB not needed 2009-01-10 13:23:37 +00:00
skodak
e70da470a7 MDL-14123 Full IPv6 support - reimplemented address_in_subnet() + added more unittests 2009-01-09 21:16:26 +00:00
skodak
65de686486 MDL-14123 cleanremoteaddr improvements and added unit tests 2009-01-09 10:16:07 +00:00
tjhunt
6ff2be37f5 moodlelib iprange checks: MDL-16986 If the user makes a mistake and types something like 172.16.1.143/148, with something greater than 32 after the slash, treat it as /32. 2008-10-24 02:53:51 +00:00
nicolasconnault
b9c639d6c2 MDL-16483 Refactored install/upgrade code into lib/adminlib. Created an intermediate MoodleUnitTestCase class that overrides simpletest's constructor, destructor and setup/teardown methods. All moodle unit tests must extend this class. 2008-09-16 12:19:43 +00:00
tjhunt
1cc6b5162c MDL-15655 - address_in_subnet does not work on 64 bit architectures. Also, we found some other issues with this funtion while diagnosing the problem. 2008-09-01 04:17:11 +00:00
skodak
bed7993115 MDL-15897 deprecated PARAM_CLEANFILE - we now support unicode everywhere 2008-07-31 23:03:50 +00:00
tjhunt
c7fd861b8e Unit tests for MDL-9295 - clean_param with PARAM_URL/PARAM_LOCALURL. Merged from MOODLE_18_STABLE. 2007-10-30 10:46:26 +00:00
nicolasconnault
56a1a88228 MDL-8605 New user directories implemented 2007-10-11 09:01:29 +00:00
nicolasconnault
b7064779f5 Updated copyright notice in header 2007-10-10 05:25:14 +00:00
skodak
cdbbd26f80 MDL-10064 global $CFG in unit test files is non standard, it is recommended to use MOODLE_INTERNAL test in all library files 2007-06-09 16:32:36 +00:00
skodak
52f81103d3 MDL-10063 simpletestlib.php included from majority of unit tests - let's include it once from the test runner itself 2007-06-09 16:17:33 +00:00
nicolasconnault
facb512c06 MDL-8792 - Simply added help icon to explain the options available regarding embedding media files in the site. 2007-03-12 05:46:41 +00:00
nicolasconnault
a205dcdc09 Upgraded weblib::format_string() so it accepts unicode htmlentities. Also added more unit tests, including a stub for an integration web-based test. 2007-03-06 05:05:45 +00:00
nicolasconnault
d499142e5a Safari 2.0 and Opera 9.0 are now detected and supported for YUI. However, preliminary tests show that drag&drop behaviour is very slow on Opera and user-unfriendly on both browsers. A YUI debug window also pops up on Safari.
I added a unit test for ajaxlib.php

Issue MDL-8417
Merged from MOODLE_18_STABLE
2007-03-01 01:31:37 +00:00
moodler
239c15765c Merged from 1.8 stable 2007-02-28 07:58:34 +00:00
tjhunt
7c9d46c96e Related to MDL-6249 - unit tests for address_in_subnet. Merged from MOODLE_17_STABLE. 2006-10-16 13:40:26 +00:00