222 Commits

Author SHA1 Message Date
Sam Hemelryk
d6abe6f744 Merge branch 'MDL-48194-master' of git://github.com/andrewnicols/moodle 2014-11-17 13:39:03 +13:00
Andrew Nicols
14ecbb2ee8 MDL-48196 phpunit: Set e-mail address for admin user at installation 2014-11-13 08:47:43 +08:00
Andrew Nicols
a9edd8a671 MDL-48194 testing: Adjust naming of testsuites in phpunit.xml
This will make it easier to run phpunit for a specific component by making
all testsuite names consistent, guessable, and in-line with the naming of
the parameter (testsuite vs. test suite).
2014-11-12 11:46:03 +08:00
Petr Skoda
1993cc02b6 MDL-47287 prevent web access to phpunit boostrap 2014-11-03 17:10:33 +08:00
Petr Skoda
ddffa9d6d3 MDL-47538 phpunit: fix invalid PHPUNIT_SEQUENCE_START constant 2014-10-06 17:31:15 +13:00
Russell Smith
9462323b13 MDL-46193 phpunit: Replace value in component config.
There are two phpunit.xml build locations, one for overall
and another for individual components.  To reduce id changes
when running different components, we use the same initial ID
in all component files when building.
2014-07-10 09:53:23 +02:00
Russell Smith
529495f7ce MDL-46193 phpunit: Use random starting value on initialization. 2014-07-04 16:33:13 +10:00
Petr Skoda
2e00d01db4 MDL-46099 session: fix use of references for session globals
This reverses the references used for global $USER and $SESSION,
the reason is that PHP does not allow references to references.
$USER is a reference to $GLOBALS['USER'] which means we cannot
put any references to it. Solution is to store the current user and session
objects in $GLOBALS['USER'] and $GLOBALS['SESSIOn'] are reference
them in $_SESSION.

This patch makes the session code behave the same way in CLI,
phpunit and normal web requests - this allows use to finally
unit test most aspects of the session code in Moodle.
2014-07-01 08:38:00 +12:00
Russell Smith
d2c58b95bb MDL-43835 phpunit: Correct unit tests.
When different ID's are set for each sequence a number
of unit test failures appear.  They have been corrected
to allow unit tests to pass with the new generator in place.
2014-06-17 19:08:01 +10:00
Marina Glancy
0313897108 Merge branch 'wip-mdl-44839' of git://github.com/rajeshtaneja/moodle
Conflicts:
	lib/phpunit/bootstrap.php
2014-06-04 10:07:03 +08:00
Rajesh Taneja
1bce3a70d9 MDL-44839 admin: Moved all system executable paths to config
AMOS BEGIN
 MOV ['gspath','assignfeedback_editpdf'],['pathtogs','admin']
 MOV ['gspath_help','assignfeedback_editpdf'],['pathtogs_help','admin']
AMOS END
2014-06-03 17:33:49 +08:00
Sam Hemelryk
79a8ea653c MDL-45513 cache: added support to unit tests for alt cache stores 2014-05-30 08:41:07 +12:00
Rajesh Taneja
6b8e46ad04 MDL-45565 core_message: Reset internal users in phpunit 2014-05-26 15:42:12 +08:00
Damyon Wiese
84f08cfa9d MDL-45606 Unit test fix for MySQL and added a comment about the removed code. 2014-05-20 18:01:32 +08:00
Damyon Wiese
726b011050 MDL-45605 Phpunit: Do not call gc_collect_cycles as part of reset.
This takes 25% of the time in running tests and there is no benefit. The
behaviour of destructors is the same before/after the patch.
2014-05-19 10:37:16 +08:00
Petr Skoda
a9236a2c3f MDL-45287 fix behat database reset between scenarios
We cannot find out if DB received any writes because behat
web access runs in different request.

This was affecting only scenarios without generators.
2014-04-28 17:02:58 +08:00
Juan Leyva
5e12b369af MDL-44954 messages: Fixed save notifications with the notification flag 2014-04-07 12:19:52 +02:00
Petr Škoda
08ec831ff8 MDL-44510 fix class guessing in phpunit 4 2014-03-26 11:32:33 +08:00
Petr Škoda
54f1423ecc MDL-44510 support PHPUnit 4.x
The old style PEAR installation is incompatible with PHPUnit 4,
nobody was supposed to use PEAR any more - composer
is the only supported library installation method now.
2014-03-20 17:30:42 +08:00
Petr Škoda
c386f35bca MDL-44339 treat unexpected debugging() calls in phpunit tests as errors 2014-03-14 11:43:46 +08:00
Eloy Lafuente (stronk7)
630bb85d9e MDL-43266 testing: avoid assoc arrays for json
Last commit switched from raw arrays to associative
arrays. That leads to json_encode() to generate an
object instead of an array, ultimately leading to
problems with the rest of code expecting an array.

By using array_values() we are moving back to the
non-associative array.

Also, fix some file permissions.
2014-03-13 22:11:03 +01:00
Eloy Lafuente (stronk7)
1700bec3c6 Merge branch 'MDL-43266_master-last-fixes' of git://github.com/dmonllao/moodle
Conflicts:
	lib/phpunit/classes/util.php
2014-03-13 19:12:25 +01:00
Petr Škoda
770eac9805 MDL-41269 disable all logging during phpunit testing 2014-02-28 14:52:26 +08:00
Jerome Mouneyrac
c78f19d153 MDL-43266 Testing sites are cleaning all test dataroot contents 2014-02-25 14:47:25 +08:00
Rajesh Taneja
623a32e50d MDL-43736 Events: Updated unit test to test context not used in event 2014-01-29 11:39:50 +08:00
Damyon Wiese
7508094a87 Merge branch 'MDL-43461_master' of git://github.com/dmonllao/moodle 2014-01-15 09:39:03 +08:00
David Monllao
ff7139d6cb MDL-43461 testing: Avoid switching to .bat files when running MinGW
MinGW can not execute .bat files (http://sourceforge.net/p/mingw/bugs/1902)
so we should not switch to .bat files when running MinGW.
2014-01-14 13:11:07 +08:00
Petr Škoda
62c8032509 MDL-34347 remove all problematic global text caching
Instead we will create new MUC caches inside each filter plugin.
Please note that all cache filters should work with local caches
without the need of strict cache invalidation.
2014-01-14 10:49:23 +08:00
Petr Škoda
32a829e85c MDL-43515 update phpunit info page 2013-12-30 15:07:27 +08:00
Dan Poltawski
dfe84ffb52 MDL-37517 testing: remove deprecated classes 2013-12-05 12:05:10 +08:00
David Monllao
7514c2f282 MDL-42842 testing: Generalization of the site info 2013-11-26 10:48:29 +08:00
Petr Škoda
2a67e105b6 MDL-41935 attempt to work around random time comparison test failures 2013-10-12 15:53:25 +02:00
Sam Hemelryk
f18f96f767 Merge branch 'wip-MDL-42016-master' of git://github.com/marinaglancy/moodle
Conflicts:
	lib/db/install.xml
	lib/db/upgrade.php
	version.php
2013-10-09 15:58:45 +13:00
Petr Škoda
e87214bda7 MDL-42078 multiple uninstall improvements and cleanup
Includes:
* update checker refactored to \core\update\ namespace
* plugininfo classes refactored to \core\plugininfo\ namespace
* plugin_manager renamed to core_plugin_manager
* redirect back to original page after plugin uninstall
* fixed assign subplugin uninstall
* move assign subplugins under the assignment in admin tree
* fixed plugininfo for all question related plugin types
* auth uninstall support
* added missing block dependencies
* added theme uninstall
* subplugin types are following the plugin on plugin overview page
* several performance improvements in plugin manager
* new warnigns when plugininfo are outdated or missing
* multiple fixes and other improvements
2013-10-07 13:10:36 +02:00
Marina Glancy
873555604f MDL-42016 repository: Simplify API to sync external files
Too many functions, too different parameters, unnecessary DB queries.
All repositories developed for Moodle 2.3-2.5 will continue to work.

Also get rid of DB field files_reference.lifetime, it is not used by
anybody except repository itself.
2013-10-06 18:05:09 +11:00
Sam Hemelryk
52dc898d16 Merge branch 'MDL-41228_master' of https://github.com/totara/openbadges 2013-10-01 13:37:44 +13:00
Petr Škoda
a9d2f1b414 MDL-41707 allow custom location of external test files used from unit tests 2013-09-27 10:47:56 +02: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
Yuliya Bozhko
ed23ad31c7 MDL-41228 phpunit: Reset message processors list in unit tests 2013-09-03 17:43:53 +12:00
Petr Škoda
f52f2c9597 MDL-41022 cleanup core_phpunit_basic_testcase 2013-08-24 16:18:19 +02:00
Petr Škoda
3405d82c91 MDL-41022 cleanup core_phpunit_advanced_testcase 2013-08-24 16:18:19 +02:00
Sam Hemelryk
93564564e4 Merge branch 'MDL-41196-m' of git://github.com/andrewnicols/moodle 2013-08-21 09:56:16 +12:00
Dan Poltawski
6f44a73369 Merge branch 'w33_MDL-39474_m26_debugdeveloper' of https://github.com/skodak/moodle
Conflicts:
	lib/upgrade.txt
2013-08-20 11:42:03 +08:00
Andrew Nicols
1aba6b2b4d MDL-41196 Unit Tests: Add a phpmailer message sink 2013-08-15 13:58:51 +01:00
Petr Škoda
96f81ea385 MDL-39474 introduce $CFG->debugdeveloper and cleanup $CFG init 2013-08-12 13:01:47 +02:00
Petr Škoda
c5701ce7d4 MDL-41086 rework detection of necessary upgrades 2013-08-08 21:11:40 +02:00
Petr Škoda
2f1e464a88 MDL-40438 migrate all collatorlib:: and textlib:: uses 2013-08-06 21:04:35 +02:00
Ankit Agarwal
320aee339c MDL-40935 phpunit: Remove assertLegacyEventName() since get_legacy_eventname() is public now 2013-08-06 14:58:30 +08:00
Sam Hemelryk
b09abb05ab Merge branch 'w32_MDL-40901_m26_phpunitcleanup2' of https://github.com/skodak/moodle 2013-08-06 08:53:24 +12:00
Petr Škoda
2e242f4c6b MDL-40940 try to guess testcase location using info from /phpunit.xml
This will help with core tests in non-standard core subsystem locations.
2013-08-04 21:44:13 +02:00