30 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
8183def69e MDL-67673 phpunit: Move tests to use new phpunit_dataset
- Make advanced_testcase old methods to use new ones internally.
- Fix advanced_testcase, statslib, mod/quiz and mod/data tests.

Originally MDL-64600
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
Víctor Déniz Falcón
5007d1cb04 MDL-58596 core_stats: unit test for stats_get_base_weekly 2019-01-08 07:36:48 +00:00
Eloy Lafuente (stronk7)
796e48a58b MDL-60611 phpunit: remove deprecated stuff and other minor fixes
Thanks @scara for MDL-60611 phpunit: improved redis skipping reasons
2017-11-05 01:45:04 +01:00
Eloy Lafuente (stronk7)
801a372dad MDL-60611 phpunit: switch to namespaced phunit classes 2017-11-02 23:45:34 +01:00
Andrew Nicols
d504e9207c MDL-59642 stats: Correct random unit test failure
The unit test was creating four events, and then relying on them being
retrieved in the order in which they were created.

I've modified the test to:
* ensure timecreated are spaced apart; and
* add an order by timecreated when fetching them.
2017-08-04 15:06:51 +08:00
Adrian Greeve
3b873397e6 MDL-22183 lib: More unit tests for next day start. 2016-08-18 10:13:31 +08:00
Adrian Greeve
4ae0691169 MDL-22183 lib: Time settings removed for stats cron.
Old settings that should be ignored have been removed from the
statistics cron code.
2016-08-18 10:13:31 +08:00
Simey Lameze
a77e0611a0 MDL-50050 core_deprecated: remove deprecated functions from 2.9 2016-04-01 09:33:30 +08:00
Petr Skoda
d6e7a63d9a MDL-49684 timezones: rewrite timezone support
This patch replaces all homegrown timezone
stuff with standard PHP date/time code.

The main change is the introduction of core_date
class that returns normalised user and server
timezones. From now on nobody should be using
$CFG->timezone or $user->timezone directly!

Other new features and fixes:
* admins are prompted for timezone during install
* editing of other users is finally fixed
* timezones are displayed in user profile
* new $this->setTimezone() in phpunit
* time locale is now automatically reset in phpunit
* timezone is now automatically reset in phpunit
* phpunit has Australia/Perth as default timezone
2015-04-06 13:53:51 +12:00
Rajesh Taneja
f978c3347a MDL-48595 core_stats: get time everytime it's used
Depending on server speed, time might be more then
expected. So rather then using variable, get current
time where required
2015-03-12 12:49:44 +08:00
Dan Poltawski
73f755a799 MDL-47502 statslib tests: improve test
While integrating I noticed some problems which already existed in this
test:
* The enrolment data generator was not used
* The student roleid was hardocded
* The role assignment was at site level..
2014-11-11 19:25:49 +00:00
Eugene Venter
ba923f4f9a MDL-47502 test_statslib_cron_daily: fix provider
Fiddling with the database in the data provider causes "out of sync"
errors when running suite tests.
2014-11-11 19:12:51 +00:00
Petr Skoda
8dcb7ae62e MDL-45128 include only education related events from real users in statistics processing 2014-04-28 11:31:31 +08:00
Petr Škoda
92927fba72 MDL-41284 hack stats to use new log readers if available 2014-03-20 17:26:09 +08:00
sam marshall
db0f0097e8 MDL-42084 Unit tests: Remove unnecessary 'clear time limit change' lines 2013-11-06 16:40:04 +00:00
Petr Škoda
96f81ea385 MDL-39474 introduce $CFG->debugdeveloper and cleanup $CFG init 2013-08-12 13:01:47 +02:00
Petr Škoda
d53111c008 MDL-39915 cleanup core_statslib_testcase 2013-07-28 15:36:26 +02:00
Petr Škoda
0ddd65d9e0 MDL-38989 add missing test timeout reset 2013-04-10 09:49:19 +02:00
Damyon Wiese
594d66c27e MDL-38840 Statslib - Fix failing unit tests on ci server (DST change) 2013-04-02 16:47:04 +02:00
Eloy Lafuente (stronk7)
613eebfc6a MDL-38212 fix related unit tests.
For statslib tests was enough to require cronlib.php as
far as all the tests there are using ob-capture / output
expectations, so the new function does not bork anything.

For pluginlib tests finally the use was deleted because
it's a part of cron not interesting (should be always "cheap")
and to keep it there we should be adding a bunch of output
expectations under some cases, for practically nothing.
2013-03-12 19:35:16 +01:00
Tyler Bannister
12ccfc123a MDL-30643 - Improved error reporting for daily stats tests. 2012-11-13 10:37:25 -05:00
Tyler Bannister
67690cfa92 MDL-30643 - Fixed timezone problems in test cases. 2012-11-12 22:47:09 -05:00
Tyler Bannister
c0f00c5fba MDL-30643 - Added statslib test file.
- Tests daily stats and daily stats related functions.
2012-11-09 16:27:25 -05:00
Eloy Lafuente (stronk7)
8127f098d8 Revert "MDL-30643 - Added statslib test file."
This reverts commit 8646f5a4363a4331c8673e2bc98a7372ed789182.
2012-09-05 19:03:06 +02:00
Eloy Lafuente (stronk7)
06d54f411c Revert "MDL-30643 - Fixing minor log output error and test cases."
This reverts commit 2da32bd6a5a0071756c29a4684c73694f0971664.
2012-09-05 19:02:54 +02:00
Eloy Lafuente (stronk7)
fa4fbd9790 Revert "MDL-30643 - Updated test cases to handle timezones better."
This reverts commit f0f0fec29572e6670cb46f4325955201f871b519.
2012-09-05 19:02:38 +02:00
Tyler Bannister
f0f0fec295 MDL-30643 - Updated test cases to handle timezones better. 2012-09-04 10:10:19 -04:00
Tyler Bannister
2da32bd6a5 MDL-30643 - Fixing minor log output error and test cases. 2012-08-31 14:52:29 -04:00
Tyler Bannister
8646f5a436 MDL-30643 - Added statslib test file.
- Tests daily stats and daily stats related functions.
2012-08-31 14:52:28 -04:00