Commit graph

320 commits

Author SHA1 Message Date
Simey Lameze
2dd31504b9 MDL-67494 calendar: set userid to zero for shared events 2021-03-03 16:06:32 +08:00
Eloy Lafuente (stronk7)
3a5641cb74 MDL-67673 phpunit: Remove deprecated assertEquals() params
The optional parameters of assertEquals() and assertNotEquals()
are deprecated in PHPUnit 8 (to be removed in PHPUnit 9):

- delta => use assertEqualsWithDelta()
- canonicalize => use assertEqualsCanonicalizing()
- ignoreCase => use assertEqualsIgnoringCase
- maxDepth => removed without replacement.

More info @ https://github.com/sebastianbergmann/phpunit/issues/3341

Initial search done with:

ag 'assert(Not)?Equals\(.*,.*,' --php

Then, running tests and fixing remaining cases.
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
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
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Jenkins Automation
5650b7e3ad MDL-69726 calendar: fix raw event fetcher under postgres
Without this, there's a code path that under the right circumstances is hit and
results in a query with `FROM (mdl_event) ev` in it - which is not valid syntax
under postgres.
2020-10-13 09:33:52 +10:30
Sara Arjona
6bb0262ed8 Merge branch 'MDL-68098-master' of git://github.com/dpalou/moodle into master 2020-10-01 12:56:16 +02:00
Juan Leyva
ea9c822fc3 MDL-68845 calendar: Move duplicated code to function 2020-09-29 10:51:45 +02:00
Dani Palou
25bc7a3d6b MDL-68098 ws: Add unit tests to test mathjax in WS 2020-09-23 11:18:41 +02:00
Andrew Nicols
33f6c33357 MDL-69391 behat: Grammar correction in feature 2020-09-03 11:34:47 +08:00
Andrew Nicols
f9c870e16f Merge branch 'MDL-69391-master' of git://github.com/junpataleta/moodle 2020-09-03 11:32:31 +08:00
Jun Pataleta
2c08e043e4 MDL-69391 calendar: Accessibility tests for calendar 2020-09-03 11:10:40 +08:00
Julien Boulen
93d7220587 MDL-67278 course: Use autocomplete widget for course category selector 2020-09-02 15:30:34 +02:00
Mikhail Golenkov
364d4caeec MDL-66716 calendar: Add usermidnight property for events. 2020-08-10 11:36:29 +10:00
Andrew Nicols
b284293402 MDL-69138 behat: Update session->visit() to use visit step 2020-07-22 16:43:08 +08:00
Marina Glancy
1a972b06f1 MDL-58866 core_calendar: allow component events 2020-05-19 19:04:13 +02:00
Simey Lameze
eaf623c5bf MDL-66871 calendar: add unit test coverage for ics importing 2020-01-06 10:36:35 +08:00
Eloy Lafuente (stronk7)
5afac432f5 MDL-67598 unit tests: Pass day of month without leading zero
Note this fixes the unit tests. Still the calendar API itself
should be able to manage this cases, both casting (int) or
being stricter about what's allowed there (param hinting).

But that falls out from this issue and the code that introduced
the failures, so the pure unit-test fix has been applied.
2020-01-02 00:06:40 +01:00
Shamim Rezaie
f046b70355 MDL-67152 calendar: The day view should start from the current day 2019-12-09 22:37:21 +11:00
sam marshall
584500d5ba MDL-67300 Calendar: Inconsistent behaviour of managegroupentries
When calling the calendar_get_allowed_event_types function with
no course id, it is supposed to return true if you have the
relevant permissions in any course.

For users who have the managegroupentries permission, this was not
the case - even though it works correctly if you call the function
with a supplied course id.

This change makes behaviour with and without a supplied course id
consistent.
2019-11-21 10:51:35 +00:00
Jake Dallimore
7296c718a1 Merge branch 'MDL-66455-master' of git://github.com/lameze/moodle 2019-11-05 11:42:48 +08:00
Michael Hawkins
23affd76c2 MDL-66373 calendar: Added datetimes to timestamps conversion web service 2019-11-04 10:04:57 +08:00
Simey Lameze
65137025ff MDL-66455 calendar: add coverage for event types in subscription page 2019-10-31 18:44:14 +08: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
Jun Pataleta
ec720611d5 MDL-61450 calendar: Unit test for calendar_view_event_allowed()
* Unit test for calendar_view_event_allowed() when dealing with course
events.
2019-10-03 15:38:43 +08:00
Simey Lameze
da6ed25999 MDL-65958 calendar: cover students default event type visibility 2019-07-03 20:39:58 +08:00
Simey Lameze
47177cd6bc MDL-65958 calendar: add behat to test calendar_adminseesall behaviour 2019-07-03 20:27:59 +08:00
Simey Lameze
ce715ce556 MDL-65707 calendar: behat scenario to test default event type 2019-06-25 09:50:27 +08:00
Jun Pataleta
f80ae63efa Merge branch 'MDL-64573-master' of git://github.com/damyon/moodle 2019-04-26 10:59:30 +08:00
Marina Glancy
669d54a48c MDL-64573 calendar: behat fix, validation is now on client 2019-04-26 10:57:04 +08:00
David Monllaó
45c8b226be Merge branch 'MDL-64782-master' of git://github.com/rezaies/moodle 2019-04-24 17:37:45 +02:00
Shamim Rezaie
ac2bfc2c37 MDL-64782 core_calendar: Privacy deletion fix
Deleting in course context should not delete from course modules
2019-04-23 17:01:48 +10:00
Juan Leyva
2aad6b8261 MDL-64641 calendar: New WS core_calendar_get_allowed_event_types 2019-04-05 09:56:39 +02:00
Juan Leyva
a46980fa79 MDL-64641 calendar: New WS core_calendar_get_access_information 2019-04-05 09:56:39 +02:00
Simey Lameze
54fec0c30b MDL-63196 core_calendar: add behat scenario 2019-03-22 10:41:00 +08:00
David Monllaó
7af6528e30 MDL-60340 calendar: New param to specify a user 2019-03-15 11:35:29 +01:00
Simey Lameze
9cf58f070d MDL-64214 calendar: fix failing unit tests 2018-11-29 13:59:36 +08:00
Adrian Greeve
c84ee67864 MDL-64063 core_calendar: Unit test for suspended users. 2018-11-21 09:51:52 +08:00
Andrew Nicols
705003beae MDL-63303 behat: Behat fixes 2018-11-15 16:26:16 +08:00
Mihail Geshoski
77134a08b2 MDL-63684 core_calendar: Fix test_get_contexts_for_userid() test
This issue is part of the MDL-62560 Epic.
2018-10-31 14:10:47 +08:00
Mihail Geshoski
c844eafd6f MDL-63684 core_calendar: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-31 14:10:08 +08:00
Shamim Rezaie
084d5ee46c MDL-62960 calendar: Rename get_module_timestamp_min/max_limit methods
The methods get_module_timestamp_min_limit() and get_module_timestamp_max_limit()
are doing generic stuff and can be used for other calendar event types as well.
I have renamed them to get_timestamp_min_limit() and get_timestamp_max_limit() respectively.
2018-10-16 12:58:25 +11: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
Víctor Déniz Falcón
02fda279ed MDL-57281 behat: deprecated step definition I navigate to node in
Definition step deprecated and affected tests modified.
2018-08-20 12:53:26 +01:00
Shamim Rezaie
7385ee37f9 MDL-58768 Calendar: Update get_raw_events_legacy_implementation
Update get_raw_events_legacy_implementation to work with the passed $users parameter instead of the logged in user.
Also, fixed a bug where get_raw_events_legacy_implementation was failing when $users was set to true, and a list of
$groups was given.
2018-07-28 07:51:32 +10:00
Shamim Rezaie
d8c6c21c95 MDL-58768 Calendar: Added user param to calendar_set_filters
Decoupled calendar_set_filters from $USER.
Also removed the backward compatibility bit from the function because it was a left over.
2018-07-28 07:41:50 +10:00
Shamim Rezaie
bd8705732d MDL-58768 Calendar: Added userid param to calendar_get_default_courses 2018-07-28 07:41:50 +10:00
Andrew Nicols
834054ee06 Merge branch 'MDL-60826-master' of git://github.com/lameze/moodle 2018-07-25 09:18:53 +08:00
Simey Lameze
375b15a346 MDL-60826 calendar: deprecate calendar_get_all_allowed_types 2018-07-24 07:58:34 +08:00
Simey Lameze
dfc609e55d MDL-60826 calendar: lazy load groups on event form 2018-07-24 07:58:34 +08:00