Commit Graph

100 Commits

Author SHA1 Message Date
Petr Škoda
b5486ce89b MDL-41953 add more tests for invalid plugin names 2013-10-11 00:09:04 +02:00
Petr Škoda
a41d1ca0ce MDL-41953 allow plugin names to end with multiple digits 2013-10-11 00:04:39 +02:00
Petr Škoda
90930acff8 MDL-42054 fix incorrect email redirection in unit tests 2013-10-09 12:08:55 +02:00
Adrian Greeve
73d363f0fa MDL-42098 - Libraries: Unit test for fullname function to ensure that debug message is
shown even when additional names are enabled.
2013-10-04 15:03:00 +08:00
Petr Škoda
d79d5ac276 MDL-31501 rework user session architecture
List of changes:
 * New OOP API using PHP namespace \core\session\.
 * All handlers now update the sessions table consistently.
 * Experimental DB session support in Oracle.
 * Full support for session file handler (filesystem locking required).
 * New option for alternative session directory.
 * Official memcached session handler support.
 * Workaround for memcached version with non-functional gc.
 * Improved security - forced session id regeneration.
 * Improved compatibility with recent PHP releases.
 * Fixed borked CSS during install in debug mode.
 * Switched to file based sessions in new installs.
 * DB session setting disappears if DB does not support sessions.
 * DB session setting disappears if session handler specified in config.php.
 * Fast purging of sessions used in request only.
 * No legacy distinction -  file, database and memcached support the same functionality.
 * Session handler name included in performance info.
 * Fixed user_loggedin and user_loggedout event triggering.
 * Other minor bugfixing and improvements.
 * Fixed database session segfault if MUC disposed before $DB.

Limitations:
 * Session access time is now updated right after session start.
 * Support for $CFG->sessionlockloggedinonly was removed.
 * First request does not update userid in sessions table.
 * The timeouts may break badly if server hosting forces PHP.ini session settings.
 * The session GC is a lot slower, we do not rely on external session timeouts.
 * There cannot be any hooks triggered at the session write time.
 * File and memcached handlers do not support session lock acquire timeouts.
 * Some low level PHP session functions can not be used directly in Moodle code.
2013-09-21 13:11:56 +02:00
Rajesh Taneja
bb78e249cd MDL-39961 Events: Replace Legacy events - User
This change includes:
* Added user_updated event, replacing old event
* Added user_created event, replacing old event
* Added user_deleted event, replacing old event
* Added user_loggedout event, replacing old event
* Added user_enrolment_created event, replacing old event
* Added user_enrolment_deleted event, replacing old event
* Added user_enrolment_updated event, replacing old event
2013-09-02 16:10:05 +08:00
Petr Škoda
bff1d60c05 MDL-40676 ignore null bytes 2013-09-02 12:25:02 +08:00
Sam Hemelryk
c3d2fbf9cd MDL-40931 useragent: separated user agent functionality into a lib
This commit moves user agent related functionality out of several
core libraries and combines it into a more manageable class.
All core uses are converted and functions deprecated in favor
of the new class.
2013-08-26 13:59:19 +12:00
Damyon Wiese
9ead041cdb Revert "MDL-40931 useragent: separated user agent functionality into a lib"
This reverts commit af62237d0e.
This reverts commit 87a4194fdc.
This reverts commit b2c66eb60c.

Conflicts:

	version.php
2013-08-22 13:31:25 +08:00
Sam Hemelryk
af62237d0e MDL-40931 useragent: separated user agent functionality into a lib
This commit moves user agent related functionality out of several
core libraries and combines it into a more manageable class.
All core uses are converted and functions deprecated in favor
of the new class.
2013-08-16 09:02:01 +12:00
Petr Škoda
2f1e464a88 MDL-40438 migrate all collatorlib:: and textlib:: uses 2013-08-06 21:04:35 +02:00
Petr Škoda
aed2b9ba9c MDL-40901 use assertInternalType() 2013-08-04 22:16:03 +02:00
Petr Škoda
be6ce11cae MDL-39915 cleanup core_moodlelib_testcase 2013-07-27 21:41:03 +02:00
Adrian Greeve
a327f25ef1 MDL-31776 - lib: Alternate name fields
Add support for additional name fields and flexible formating of
user names.
2013-07-09 11:45:50 +08:00
Ankit Agarwal
0601e0eef6 MDL-40402 libraries: Replace get_system_context() with context_system::instance() in core 2013-07-04 15:41:06 +08:00
Petr Škoda
9e19a0f08b MDL-39854 reimplement Frankenstyle support and enable classloader
Better performance, more reliable, completely self contained,
more validation and full backwards compatibility.

This will also allow us to implement ignoring of plugins.
2013-06-18 09:10:07 +02:00
Gilles-Philippe Leblanc
d381fb7776 MDL-38239 gradebook: Importing grades from a .txt file with commas for decimals causes an error 2013-05-21 14:15:26 -04:00
Tim Hunt
5f85073525 MDL-39445 get_plugin_list clean_param use is slow
get_plugin_list was calling clean_param($pluginname, PARAM_PLUGIN) a
lot (600+ times per page), and that is much slower than you would guess.
A specific function for this case, (which we then also use from
clean_param) is a performance win.
2013-05-02 16:20:24 +01:00
Petr Škoda
f869cb2326 MDL-39077 add more unit tests for get_max_upload_sizes() 2013-04-27 16:08:15 +02:00
Tim Hunt
4a7cc24808 MDL-35364 shorten text: don't return invalid HTML.
I also broke the unit tests into more, smaller, named tests, so that
when things start failing, more tests are run, and it is clearer what
the problem is.

In a couple of cases, I adjusted the $ideal lenght in the test. A
careful counting of the characters in the test input (added as comments)
suggests that the new values make for better tests.
2013-04-22 19:21:40 +01:00
Eloy Lafuente (stronk7)
d506f422c9 MDL-38999 timezones: add some TZ/stamps know to be problematic to tests. 2013-04-08 16:09:41 +02:00
Damyon Wiese
a052fe8a6b MDL-37122 core get_max_upload_sizes: Removed unit test for no limit as it is depends on settings in php.ini 2013-02-11 15:18:12 +08:00
Damyon Wiese
1e7db9fee8 Merge branch 'master_MDL-35332' of git://github.com/totara/moodle
Conflicts:
	lib/tests/moodlelib_test.php
	version.php
2013-02-11 14:51:11 +08:00
Simon Coggins
ec2d8ceb88 MDL-35332 lib: Improve security of hashed passwords 2013-02-09 06:47:57 +13:00
Damyon Wiese
6b219310cf MDL-37122 core get_max_upload_sizes: Include "Course/Site/Activity limit (X)" in list of options
This change removes the "0 bytes" option from the get_max_upload_sizes list
and replaces it with "Course limit (X)" or "Site limit (X)" (whichever is smaller).
This means we can remove all custom handling in the modules that were removing and
adding these options. It only affects pages that pass valid options for sitelimit and
courselimit - so admin pages will work correctly.

It also orders the list so the course/site limit options will be first
(as it will be the largest).

AMOS START
 REM [courseuploadlimit, core] has been parameterized to get [uploadlimitwithsize, core]
AMOS END
2013-02-07 10:50:52 +08:00
Eloy Lafuente (stronk7)
5ab0371d74 Merge branch 'MDL-37854_master' of https://github.com/markn86/moodle 2013-02-05 11:10:48 +01:00
Mark Nelson
17222a4a25 MDL-37854 phpunit: replaced occurrence of non-existent function assertFail 2013-02-05 18:03:25 +08:00
Petr Škoda
73d20f36cb MDL-37780 hack around some unicode date formatting issues on Windows 2013-01-30 22:36:40 +01:00
Frederic Massart
31a783303e MDL-29749 phpunit: Windows dir uses backslashes 2013-01-22 16:24:35 +01:00
Eloy Lafuente (stronk7)
37027f431b Merge branch 'MDL-29749-master-4th' of git://github.com/FMCorz/moodle 2013-01-21 23:26:35 +01:00
Frederic Massart
caf16a57e5 MDL-29749 files: Improved params PARAM_PATH and PARAM_FILE
The logic change here allows for multiple dots to be part
of a file name or folder name. Most Unit Tests have not
been altered and reflect the exact logic as it was before.
2013-01-17 11:32:59 +08:00
Sam Hemelryk
7f30a6449b MDL-34344 config: added unit tests for get_config 2013-01-08 09:52:19 +13:00
Jerome Mouneyrac
8158ce79f9 MDL-36773 timezone inconsistency => some number support decimal other don\'t - Original patch author: Nathan Mares 2012-11-30 10:11:55 +08:00
Petr Škoda
3c1405a1ee MDL-36481 improve IE version sniffing 2012-11-09 15:23:22 +01:00
Dan Poltawski
3bd6e74afd Merge branch 'w42_MDL-35469_m24_geckover' of git://github.com/skodak/moodle 2012-11-02 12:07:11 +08:00
Frederic Massart
a8397303d2 MDL-35412 phpunit: date_format_string() is case insensitive 2012-10-16 17:21:11 +08:00
Frederic Massart
15396bba9b MDL-35171 Forms: Date selector always gets UTF-8 strings 2012-10-15 09:46:02 +08:00
Petr Škoda
e71c516065 MDL-35469 test for the new Gecko user agent handling 2012-10-13 09:59:28 +02:00
Marina Glancy
7b444a96ec MDL-35001 added unit test for function convert_to_array() 2012-09-20 15:37:25 +08:00
Petr Škoda
a3b6e311b8 MDL-35479 some more debugging assert cleanup 2012-09-17 12:06:24 +02:00
Petr Škoda
c8bc6c1548 MDL-35479 fix moodlelib tests to use debugging asserts 2012-09-17 11:58:43 +02:00
Petr Škoda
4366ce8097 MDL-35145 add basic unit tests for delete_user() 2012-09-01 14:13:40 +02:00
Frederic Massart
7b05e14659 MDL-28531 Unit Tests: Fixed tests to work with core update 2012-08-17 15:00:10 +08:00
Petr Škoda
9a97fa5a65 MDL-34538 add float validation tests 2012-07-27 18:44:27 +02:00
Petr Skoda
0aff15c2c9 MDL-33007 add workaround for broken iconv //IGNORE
This patch adds mbstring utf-8 cleanup fallback and admin warning if no utf-8 cleanup possible in user submitted data.
2012-06-01 12:23:09 +02:00
sam marshall
637da99edb MDL-24419 (3): Add new parameter to format_float for shorter display 2012-05-14 11:15:16 +01:00
Eloy Lafuente (stronk7)
03764014af MDL-32234 Library: usergetdate tests moved to assertSame()
(to check both type and value)
2012-05-03 00:52:25 +02:00
Rajesh Taneja
4a9c429b0c MDL-32234 Library: usergetdate return different values when timezone is set
usergetdate should return consistent values for different timezone. There are
two return path
1. If timezone is servertime, it returns getdate
2. If timezone other then servertime, it use gmstrftime, which returns string and
   values with leading zero.
In second case, leading zero's are removed and values are type casted. One major fix
is with yday, getdate returns 0 through 365, whereas %j returns 001 through 366. This
has been fixed as well.
2012-04-30 10:59:01 +08:00
Petr Skoda
4b02743182 MDL-32149 improve testcase naming and list in config file 2012-04-03 22:30:57 +02:00
Petr Skoda
a3d5830a0a MDL-32149 PHPUnit test support - part 2
Includes:
* constants refactoring
* reworked db table init
* support for $CFG->debug = -1
* functional DB tests
* fixed $DB->get_indexes() to not throw exceptions when table does not exist
* fix handling of user passwords in test db
* add debug info to exception messages
* removed unnecessary PHP debug errors from mathslib
* fixed @error suppression in get_string
* fixed PHPUnit error handler setup
* added timezone info to default install
2012-04-03 22:30:53 +02:00