Commit Graph

50 Commits

Author SHA1 Message Date
Andrew Nicols 08ac68de3e MDL-61068 mod_forum: Fix neighbour test dates 2018-01-09 09:08:40 +08:00
Ankit Agarwal bb40a28d9b MDL-58497 forum: Show correct itemcount on action events 2017-05-01 13:48:30 +05:30
Jake Dallimore 8db355c58f MDL-58138 tests: unit and behat tests covering bulk and default tabs
Part of MDL-58138 epic
2017-04-19 08:56:11 +08:00
Andrew Hancox d2ba493cfe MDL-46929 mod_forum: Implement tagging 2017-04-11 08:30:09 +01:00
Mark Nelson e1cd93ce20 MDL-58423 core_calendar: moved \core_calendar\event class
Part of MDL-55611 epic.
2017-04-04 11:01:49 +01:00
Damyon Wiese 739de5fefe MDL-58087 mod_forum: Fix fragile test
This test was dependant on the randomly generated group names coming back in a
specific order.

Part of MDL-55611 epic.
2017-04-04 11:01:42 +01:00
Mark Nelson 6c83e65928 MDL-57878 mod_*: added unit tests for event decoration
Part of MDL-55611 epic.
2017-04-03 11:37:09 +08:00
Mark Nelson e9dfeec94e MDL-57434 core: deprecated xxx_print_overview() and related functions
Part of MDL-55611 epic.
2017-04-03 11:33:55 +08:00
David Monllao 1535cd5bad MDL-58450 mod_forum: Force groups to be returned as they are created
Long history resumed: The test relies on the first group
being the first that is created, the first group is
actually the first one ordering by name. If  is
group-999 and  is group-1000  is returned
as the first group.
2017-03-31 01:44:21 +02:00
David Mudrák 106f23730a MDL-57677 mod_forum: Fix wrong user displayed as the last post's author
In the recent issue MDL-56225, we started to record the current user as
the usermodified in the forum_discussions table when updating a forum
post. It made sense but it was a mistake.

Even if the current user really modifies the discussion by updating the
post, the field usermodified has actually been always interpreted and
displayed as the last post' author. Not as the last user who touched the
discussion.

This patch reverts that particular change to the previous behaviour and
adds explicit unit test for it.
2017-01-17 19:45:17 +01:00
Andrew Nicols 0f3bbfd4f8 MDL-55982 mod_forum: Add time-based discussion locking
This patch adds support for time-based locking of discussions.
Discussions are automatically locked after a user-definable period of
inactivity. After this time, only those with the the relevant capability
are able to add replies.

This has been designed to add support for other types of discussion locking
at a later date with relative ease.
2016-09-21 09:03:42 +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
Jun Pataleta af0fc6a254 MDL-18599 mod_forum: Hide single discussion owner's name and picture
* On the discussion's page.
* On the recent activity block.
* On the recent activity page.
2016-07-11 21:40:19 +08:00
Andrew Nicols c0e3c8ae0d MDL-52942 forum: Allow posting to multiple groups in eachuser forums 2016-04-11 12:23:47 +08:00
Andrew Nicols 985dca606f MDL-52930 forum: Fix random test failure caused by passing of time 2016-02-10 12:24:09 +08:00
Andrew Nicols d6ffb0277a MDL-52930 mod_forum: Add get_unmailed_posts tests 2016-02-05 14:33:17 +08:00
Ryan Wyllie f9621c56c4 MDL-372 forum: tests for pinned discussions 2016-01-13 02:01:27 +00:00
Ben Kelada 5f219cf181 MDL-372 forum: Improve pinning and update for Moodle 3.0 2016-01-13 02:01:26 +00:00
Dan Poltawski 7931245f95 Merge branch 'wip-mdl-52656' of https://github.com/rajeshtaneja/moodle 2016-01-12 10:39:46 +00:00
Rajesh Taneja faea241337 MDL-52656 unittest: Reset original session while setting user 2016-01-08 09:41:28 +10:00
Andrew Nicols 6667ebb98e MDL-52000 mod_forum: Respect timed posts in course overview block 2016-01-07 16:57:27 +08:00
Andrew Nicols 4aaa38e8fa MDL-52000 mod_forum: Respect timed posts in course overview block 2016-01-06 16:20:48 +08:00
Andrew Nicols 23079c2941 Merge branch 'MDL-49566_master' of git://github.com/markn86/moodle 2016-01-04 13:53:40 +08:00
Mark Nelson be5e0110ff MDL-49566 core: used reflection in unit tests
Also split the tests into multiple functions for each scenario.
2015-12-29 17:42:43 +08:00
Ankit Agarwal bef0d6b052 MDL-49566 core: Write unittests for MDL-45898 2015-12-29 11:22:42 +08:00
Andrew Nicols 6ec766069c MDL-52597 mod_forum: Remove sleep from tests 2015-12-23 14:24:35 +08:00
Juan Leyva 04cd8ae3c0 MDL-52165 mod_forum: New Web Service mod_forum_can_add_discussion 2015-12-04 15:30:16 +01:00
Adam Olley 1e36665719 MDL-50993 forum: Display timed posts/discussions in a logical order
Users that don't have permission to view timed posts outside of the release
time frame will have discussions that have entered the visible frame appear
in an odd order from their point of view on the discussion list.

Example:
Discussion 1, modified 2015-01-01, hidden till 2015-01-03
Discussion 2, modified 2015-01-02, not hidden

The standard 'modified descending' order means that D2 is listed at the top
even after D1 becomes visible. When scanning the list of discussions for new
posts, the user could be tricked into thinking they'd already read it.

This fix instead takes into account the release time of the discussion when
timed forum posts are enabled.

I opted to use CASE statements to handle this instead of GREATEST as the
latter is not supported by MSSQL.
2015-10-19 04:04:58 +00:00
Juan Leyva 4f3a2d2103 MDL-51637 forum: Make forum_get_discussions_paginated return group post 2015-10-12 10:08:17 +02:00
Dan Poltawski 158cc03737 Merge branch 'MDL-50109-master-blogsort' of https://github.com/mudrd8mz/moodle 2015-09-28 10:44:47 +01:00
Ankit Agarwal 731c2712e7 MDL-50173 ratings: Use proper checks to ensure ratings are viewable.
Mainly to verify groups visibility this new callback has been created.

Note this was originally 3 commits but for amending purposes they have
been squashed.
2015-09-09 04:07:21 +02:00
David Mudrák 8d960707c4 MDL-50109 forum: Add unit tests for the forum_get_discussion_neighbours
The added tests are variants of existing tests for blog-like forums.
2015-08-31 09:55:02 +02:00
David Mudrák 9e381efd1f MDL-50109 forum: Respect chronological order of blog posts in prev/next
The function forum_get_discussion_neighbours() is used to generate links
to neighbour discussions. I had to change the signature of the function
to have access to the forum's type without the need to re-read it from
the database in additional query.

The SQL query for blogs is a variant of the existing query, just using
the first post's creation time instead of the discussion's timemodified
time.
2015-08-31 09:55:02 +02:00
Juan Leyva 6e5df52c80 MDL-49503 forum: Unit tests for forum_discussion_view 2015-04-02 17:08:42 +02:00
Juan Leyva ebfa74c799 MDL-49502 forum: Unit tests for forum_view 2015-03-27 11:33:35 +01:00
Andrew Nicols 94802d3518 MDL-49216 mod_forum: Add tests for discussion reply count 2015-02-24 08:29:43 +08:00
Frederic Massart 826cb6f6a1 MDL-8501 mod_forum: Test coverage of neighbour discussions 2014-07-25 09:55:29 +08:00
Andrew Nicols e3bbfb52c4 MDL-1626 mod_forum: Add functions to change user discussion subscription state 2014-06-24 12:16:34 +08:00
Andrew Nicols 59075a4349 MDL-1626 mod_forum: Move subscription management to a separate class 2014-06-24 12:16:33 +08:00
Andrew Nicols 7bb7de44cf MDL-45075 mod_forum: Add unit tests for forum subscription on forum creation 2014-04-23 16:07:50 +08:00
Marina Glancy 1b066c06c6 Merge branch 'MDL-43440-master' of git://github.com/mr-russ/moodle 2014-02-03 13:42:23 +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
Mark Nelson 50ac4392f3 MDL-40909 mod_forum: removed duplicated test (duplicated in enrol/meta/tests/plugin_test.php) 2014-01-27 19:11:38 -08:00
Russell Smith 74b63eae76 MDL-43440 unit testing: Use cmid in unit tests when it should be used.
instance is has been used instead of cmid.  This works as all id's are 1
in most cases, but not always.

accesslib_clear_all_caches_for_unit_testing was updated to clear the
$USER->access cache which would fail test when the wrong user's data was used.
2014-01-25 08:57:32 +11:00
Eric Merrill bd8f5d459d MDL-29663 forum: Replace constant FORUM_TRACKING_ON with FORUM_TRACKING_FORCED
Commit for MDL-29663 that renames the FORUM_TRACKING_ON constant
to FORUM_TRACKING_FORCED to allow easier and more consistant reading.

FORUM_TRACKING_ON retained but marked depreciated.
2013-10-08 08:04:55 -04:00
Eric Merrill 20e6782f10 MDL-29663 forum: Option to allow Forced for read tracking.
Converts the use of Read Tracking On to Forced. Adds new admin setting
forum_allowforcedreadtracking. If set, Forced will be available when
adding or editing forums. In this state the forced forum overrides the
user preference of off.

With forum_allowforcedreadtracking not set (default) behavior is the
same as now, except forums previously set in the On state are treated
as Optional.

The side effect of forum_allowforcedreadtracking being on, is that users
cannot speed up the loading of course pages with lots of forums by
setting their personal forum read tracking option to off.
2013-10-08 08:03:54 -04: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
Dan Poltawski 72c2c0bb09 MDL-41191 add more test data to trigger duplicate course records 2013-08-21 14:17:12 +08:00
Dan Poltawski de31668790 MDL-41191 forum: unit tests for forum_get_courses_user_posted_in 2013-08-15 11:50:08 +08:00
Frederic Massart 62b3b99784 MDL-39954 mod_forum: Replacing old-style events_trigger 2013-08-12 17:35:29 +08:00