155 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
d95c378771 MDL-67673 phpunit: Remove expectedException annotations
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

The annotations `@expectedException`, `@expectedExceptionCode`,
`@expectedExceptionMessage`, and `@expectedExceptionMessageRegExp`
are now deprecated.
Using these annotations will trigger a deprecation warning
in PHPUnit 8 and in PHPUnit 9 these annotations will be removed.

Also, all uses of expectExceptionMessageRegExp() has been moved
to expectExceptionMessageMatches(). See https://github.com/sebastianbergmann/phpunit/issues/3957

TODO: Various weirdness found while doing the changes with these tests:
- vendor/bin/phpunit lib/tests/exporter_test.php (created MDL-69700)
- vendor/bin/phpunit competency/tests/external_test.php (same issue than prev one)
- vendor/bin/phpunit question/engine/tests/questionengine_test.php (created MDL-69624)
- vendor/bin/phpunit lib/tests/event_test.php (created MDL-69688)
2020-10-21 12:46:00 +02:00
Andrew Nicols
b430493ca8 MDL-68705 testing: Allow composer updates to be disabled 2020-08-20 20:11:13 +02:00
Michael Hawkins
4157e2d4f3 MDL-68348 lib: Added create_user_course_lastaccess generator
This creates a last access record for a user within a course.
It is requires for testing accesssince participants filtering.
2020-05-25 18:10:53 +08:00
Marina Glancy
5b529aca15 MDL-68333 testing: trigger user_created event in user generator 2020-05-19 19:11:54 +02:00
David Mudrák
866ce1fbe9 MDL-68645 output: Make other generators fail if they init the output too
Identically to what we've added to the module generators, let's raise a
coding exception if generating a block or a repository triggers the
theme and output initialisation.
2020-05-14 07:55:19 +02:00
Tim Hunt
f883c681ff MDL-68645 output: Make module generators fail if they init the output
The coding exception hint should say it all. Creating an activity module
should not need any output function call. It turned out it can lead to
hard-to-debug bugs and unexpected behaviour. So better to explicitly
fail and let the developer fix the code.
2020-05-13 10:03:01 +02:00
Pau Ferrer Ocaña
375d82cafc MDL-66612 calendar: Change global events to site events
AMOS BEGIN
 CPY [category,moodle],[category,calendar]
 CPY [site,notes],[eventtypesite,calendar]
 CPY [site,moodle],[site,calendar]
 MOV [typesite,moodle],[siteevent,calendar]
AMOS END
2019-10-21 09:33:01 +02:00
Andrew Nicols
fc1785b086 MDL-60978 testing: Support ability to run phpunit in isolated process 2019-06-21 14:36:13 +08:00
Simey Lameze
1fefa3ce7a MDL-63643 core_test: make possible to change users last ip field 2019-05-28 11:11:29 +08:00
Amaia Anabitarte
3204deacfe MDL-64993 core_message: Add self-conversations to create_user generator 2019-05-05 22:41:35 +02:00
Jason Platts
f7af1e0b9c MDL-65220 behat: test scenarios sometimes do not clear database data 2019-03-29 15:39:31 +00:00
Andrew Nicols
aac98ca7df MDL-62514 behat: Remove potentially conflicting names from description 2019-01-30 08:24:32 +08:00
Marina Glancy
bbf60b1412 MDL-57898 core_customfield: coding style fixes 2019-01-18 14:28:24 +01:00
Daniel Neis Araujo
01c1095954 MDL-57898 core_customfield: Custom fields API
This commit is part of work on Custom fields API,
to minimize commit history in moodle core the work of a team of developers was split
into several commits with different authors but the authorship of individual
lines of code may be different from the commit author.
2019-01-18 14:28:17 +01:00
Jake Dallimore
19237383f3 MDL-63884 core: allow tests to set group pictures when creating groups 2018-11-06 16:42:46 +08:00
Marina Glancy
442f12f81a MDL-62742 core: rename coursecat->core_course_category
Also rename course_in_list -> core_course_list_element
Deprecate class coursecat_sortable_records
2018-08-28 11:36:23 +02:00
Andrew Nicols
e984917db8 MDL-55609 testing: Add a create_and_enrol helper 2018-06-01 07:30:32 +08:00
Matteo Scaramuccia
ef844148a9 MDL-60923 backup: Added $CFG->backuptempdir
The new setting will allow to host the temporary backup files
into a specific target directory. Defaults to '$CFG->tempdir/backup'.

Calling make_backup_temp_directory() checks that the required sub-directory
will be properly created under the new target directory.
2018-04-16 23:50:28 +02:00
Andrew Nicols
68c2b72673 MDL-61223 course: Set default course start date 2018-01-16 14:26:19 +08:00
Andrew Hancox
64cd459648 MDL-50666 core: Rename allow_ACTION to core_role_set_ACTION_allowed 2017-12-19 13:53:23 +13:00
Andrew Hancox
a63cd3e2ca MDL-50666 core: Add function get_viewable_roles to set role visibility 2017-12-19 13:53:23 +13:00
sam marshall
a938e4096c MDL-60174 core_dml: fix miscellaneous incorrect recordset usage
The new recordset support for Postgres requires transactions and
will cause errors if recordsets are not closed correctly. This
commit fixes problems that were identified during unit tests, and
via some basic code analysis, across all core code. Most of these
are incorrect usage of recordset (forgetting to close them).
2017-11-27 11:10:33 +00:00
Juan Leyva
44ae08383b MDL-60813 calendar: Fix core_calendar_get_calendar_events for categories
Users couldn’t see category events when filtering by categories in the
core_calendar_get_calendar_events WS.
2017-11-16 19:16:01 +01:00
Andrew Nicols
fb3c0fc38b MDL-59890 calendar: Allow event creation in behat 2017-10-04 11:16:06 +08:00
Dan Poltawski
58a9d391a6 Merge branch 'wip-MDL-59287-master-v3' of git://github.com/abgreeve/moodle 2017-07-11 11:29:53 +01:00
Adrian Greeve
190646bd75 MDL-59287 core_completion: Update to unit tests. 2017-07-10 09:40:02 +08:00
sam marshall
557554f99f MDL-58957 Global search: Add time fields to block_instances 2017-06-29 15:14:47 +01:00
Marina Glancy
89b909f6de MDL-57769 course: prepare to remove numsections option 2017-03-30 08:26:12 +08:00
Marina Glancy
8341055eb4 MDL-4782 course: Allow activities in the "stealth" mode
Add field 'visibleoncoursepage' to the course_modules table
Add site-wide setting for turning on stealth mode availability
Add callback for "stealth" mode support in the course formats
Change display of modules/sections availability on the course page
2017-02-14 16:38:05 +08:00
Russell Smith
a169739d5d MDL-56273 cache: Use cache initialise always.
purge_all() and purge_by_definition() look in the configuration
for which caches are available and then creates them to purge them.
The configuration stores the values used by initialise(), not
initialise_unit_test_instance() and would therefore fail to purge
all caches if they were not purged by another means.

In the case of filestore, it's purged by unit tests, in the case
of memcache(d), it purges the whole store when a single definition
is requested.

Therefore all configuration was moved into the configuration file
during unit tests and does not have any special override codes in
the unit test infrastructure.
2016-10-30 13:42:43 +11:00
Dan Poltawski
d5e902d3ab Merge branch 'MDL-55143' of https://github.com/mr-russ/moodle 2016-10-25 18:40:06 +01:00
Jun Pataleta
c314d6ed8e MDL-53832 enrol_lti: Unit tests for tool_provider
Original subtask: MDL-55647.
2016-10-19 11:14:27 +08:00
Russell Smith
4f391d7a33 MDL-55143 unittests: Check the db rather than cache for version hash. 2016-10-18 09:35:22 +11:00
Andrew Nicols
be16d66087 MDL-55379 phpunit: Coding style fix 2016-09-22 15:11:16 +08:00
Rajesh Taneja
095883d1ea
MDL-55379 phpunit: Remove directory seperator if present 2016-09-22 12:56:48 +08:00
Rajesh Taneja
544de35bc3
MDL-55379 phpunit: Preserve config option if passed 2016-09-22 10:45:47 +08:00
Rajesh Taneja
1b319d3d3b
MDL-55379 phpunit: Fix dir separator for cli commands 2016-09-12 09:48:40 +08:00
Rajesh Taneja
a7f202de4e
MDL-55379 phpunit: Fixed hint_result for rerun 2016-09-12 09:48:39 +08:00
Rajesh Taneja
cc0ac30488
MDL-55764 behat: Reset static update db list
While running multiple suites we should
ensure static cli cache is also reset.
2016-08-30 08:00:01 +08:00
David Monllao
30daa61475 Merge branch 'wip-mdl-55072' of https://github.com/rajeshtaneja/moodle 2016-08-24 09:26:29 +08:00
Rajesh Taneja
5aa9b5cee3
MDL-55072 behat: Added support for overriding theme tests 2016-08-24 08:57:15 +08:00
Rajesh Taneja
e99f0cbba6
MDL-55072 behat: refactor behat_config_manager 2016-08-19 06:49:13 +08:00
Rajesh Taneja
39eb8abe15
MDL-46514 behat: Delete tablesupdatedbyscenario before suite
Delete tablesupdatedbyscenario before db reset to ensure
db is fully reset. In case user exits or process terminated
then the file will be left and can lead to wrong results
2016-08-19 06:46:27 +08:00
David Monllao
837cec00f9 Merge branch 'wip-mdl-55091-m' of https://github.com/rajeshtaneja/moodle
Conflicts:
	lib/upgrade.txt
2016-07-26 10:14:30 +08:00
Rajesh Taneja
52f3e060e4
MDL-55091 phpunit: Following has been deprecated.
1. getMock()
2. setExpectedException()
3. checkForUnintentionallyCoveredCode renamed to beStrictAboutCoversAnnotation
4. beStrictAboutTestSize renamed to enforceTimeLimit
5. UnitTestCase class is now fully removed.
2016-07-26 10:11:30 +08:00
Rajesh Taneja
fc2e137750 MDL-55174 core_testing: Use proper directory separator
While searching for existing files if directory
separator is not correct then original files
and directories will be deleted. So use DIRECTORY_SEPARATOR.
2016-07-15 13:51:41 +08:00
Rajesh Taneja
13708875d3 MDL-54573 testing: don't uppercase dbtype 2016-05-17 17:16:12 +08:00
Dan Poltawski
fc3d70d798 MDL-54573 testing: don't uppercase dbtype 2016-05-16 08:25:10 +01:00
Dan Poltawski
f6cbdf788a MDL-54573 testing: use dbtype rather dbvendor for diagnostics
So that we can differentiate between drivers
2016-05-13 14:49:42 +01:00
Simey Lameze
ac9768fc1b MDL-52781 core_user: replace direct PARAM_ usages.
This commit replace as much as possible of clean_param and PARAM_ usages related to user object.
Also few unit tests has been changed to match the new validation
2016-04-21 15:24:36 +08:00