1067 Commits

Author SHA1 Message Date
Petr Škoda
bdaf91fd13 MDL-43931 add logging unit tests 2014-02-28 14:52:27 +08:00
Petr Škoda
770eac9805 MDL-41269 disable all logging during phpunit testing 2014-02-28 14:52:26 +08:00
Petr Škoda
7eaca5a810 MDL-37658 add new logging API with basic implemenation 2014-02-28 14:52:24 +08:00
David Monllao
decf1e14c8 MDL-43738 behat: More info about how to get/set fields 2014-02-27 18:22:06 +08:00
David Monllao
a525414125 MDL-43738 behat: Updating steps definitions and deprecating methods 2014-02-27 18:22:05 +08:00
David Monllao
c3f1e9532d MDL-43738 behat: Normalization and major refactoring of getters and setters
Every single step that sets or gets a value from a field
has been updated to follow the same behaviour both when
using it through a single step or through generic steps
like "I fill the moodle form with:", to resume all the
changes:
- Created a behat_form_group to re-guess the field type
  and act appropriately setting and getting it's value
- Normalize all getters and setters to use behat_form_field
  children
- Complete behat_form_checkbox to trigger the appropiate JS
  event needed to perform some JS scripts that are listening
- Refactor MDL-43713 multi-select changes and remove
  the two new steps introduced there as that behaviour can
  be managed from the generic getter
- Added a new step definition to check a capability permission
  as we changed the way radio buttons gets it's value
2014-02-27 18:22:03 +08:00
Eloy Lafuente (stronk7)
5f66d46e22 MDL-43713 behat: improve multi-select support
This patch implements:

1) Normalization of options. Before the patch options
in a select were being returned as "op1 op2 op3" by selenium
and "op1 op2 op3" by goutte. With the patch, those lists
are always returned like "op1, op2, op3". If real commas are
needed when handling multiple selects they should
be escaped with backslash in feature files.

2) Support for selecting multiple options. Before the patch
only one option was selected and a new selection was cleaning the
previous one. With the patch it's possible to pass "op1, op2" in
these steps:
  - I fill the moodle form with (table)
  - I select "OPTION_STRING" from "SELECT_STRING"

3) Ability to match multiple options in this steps. Before the
patch matching of multiple was really random, now every every
passed option ("opt1, opt2") is individually verified. It applies
to these 2 steps:
  - the "ELEMENT" select box should contain "OPTIONS"
  - the "ELEMENT" select box should not contain "OPTIONS"

4) Two new steps able to verify if a form have some options selected or no:
  - the "ELEMENT" select box should contain "OPTIONS" selected
  - the "ELEMENT" select box should contain "OPTIONS" not selected

5) Change get_value from xpath search to Mink's getValue() that is immediate
(does not need form submission) and works for all browsers but Safari, that
fails because of the extra ->click() issued.

Note all the changes 1-4 only affect to multi-select fields. Single
selects should continue working 100% the same.

The change 5) causes Safari to fail. The problem has been traced down to
the extra ->click() present there. Anyway there are not test cases
requiring that "immediate" evaluation right now. Only the special feature
file attached verifies it.
2014-02-27 18:21:43 +08:00
Damyon Wiese
309ae8921f MDL-25499: Centralise management of all types of cron tasks
Centralise management of all types of cron tasks with registration, scheduling,
parallel task conflicts(blocking) and running once off tasks, all using an
administration screen.

This is a combination of several issues:

MDL-25502: Added "black magic" task allocator for cron
MDL-25503: Add step to cron to run all scheduled tasks
MDL-25504 cron: Refactor to use scheduler
MDL-25505: Add an admin interface to schedule tasks via cron.
MDL-25507: Add support for adhoc tasks.
2014-02-26 12:03:46 +08:00
Damyon Wiese
237243db02 Merge branch 'MDL-43837_master' of git://github.com/dmonllao/moodle 2014-02-24 16:56:05 +08:00
Damyon Wiese
dea614e493 Merge branch 'MDL-44108_master' of git://github.com/dmonllao/moodle 2014-02-24 15:42:32 +08:00
David Monllao
74c78e7483 MDL-43837 behat: Adding reduced timeouts
There are steps where we want to check that
"something" does not appear in the page
or does not exist. We still have to spin
but we don't need to spin for 6 seconds.
2014-02-24 09:43:24 +08:00
David Monllao
702851c071 MDL-44108 behat: Adding a roles data generator 2014-02-21 13:25:44 +08:00
David Monllao
167486b316 MDL-44111 behat: Limiting dump files filename size 2014-02-21 13:21:58 +08:00
James Pratt
ac3e5ed7ba MDL-41755 tablelib : added a function to add multiple rows at once 2014-02-14 14:13:02 +07:00
Sam Hemelryk
72d953e19e Merge branch 'MDL-44059-master' of git://github.com/ankitagarwal/moodle 2014-02-10 15:58:36 +13:00
Ankit Agarwal
807241b991 MDL-44059 libraries: Add a method to return html for row instead of just printing it 2014-02-10 10:44:20 +08:00
Sam Hemelryk
5e45f31d83 Merge branch 'MDL-42882-master' of git://github.com/danpoltawski/moodle 2014-02-10 13:12:57 +13:00
Dan Poltawski
6c704b1534 MDL-42882 upgrade: Improvements to upgrade code
Suggested by Petr:
* Don't rely on single user for upgrade
* Make the pathnamehash generation a bit clearer (and add
  a test to verify its correctly formed).
2014-02-05 14:38:39 +08:00
Sam Hemelryk
3ec0946e10 Merge branch 'MDL-43027-master' of git://github.com/jamiepratt/moodle 2014-02-05 11:44:49 +13:00
Eloy Lafuente (stronk7)
5ecfa56512 Merge branch 'MDL-43911-master' of git://github.com/andrewnicols/moodle 2014-02-04 10:53:17 +01:00
Marina Glancy
e5fd05a368 Merge branch 'MDL-41754-master' of git://github.com/jamiepratt/moodle 2014-02-04 15:44:51 +08:00
Eloy Lafuente (stronk7)
d29b8f4342 Merge branch 'MDL-33064-master' of git://github.com/danpoltawski/moodle 2014-02-04 00:59:58 +01:00
Sam Hemelryk
7c8c6aa76b Merge branch 'wip-mdl-40911' of https://github.com/rajeshtaneja/moodle 2014-02-04 09:53:16 +13:00
Dan Poltawski
119cf17eec MDL-42882 upgrade: unit tests for root folders upgrade
Just verifying the original behaviour
2014-02-03 17:29:51 +08:00
Marina Glancy
c8e346f799 Merge branch 'w05_MDL-43905_m27_loginevents' of git://github.com/skodak/moodle 2014-02-03 15:17:18 +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
Andrew Nicols
a964ead06d MDL-43911 Behat: Save dumps of the page content to disk on scenario failure 2014-02-02 20:34:10 +08:00
Tim Hunt
e06bb5f800 MDL-43926 Unit tests shouldn't assume only one category on install 2014-01-31 13:31:17 +00:00
Petr Škoda
54b1e0409c MDL-43905 fix update of user login times
There needs to be only one event during user login.
The timemodified field is not supposed to be updated during login.
2014-01-31 10:08:01 +08:00
Rajesh Taneja
140118e3e8 MDL-40911 events: replaced add_to_log with events for login failed 2014-01-30 12:12:02 +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
Sam Hemelryk
453d66b782 Merge branch 'MDL-25500-master-squashed' of git://github.com/damyon/moodle 2014-01-29 13:21:00 +13:00
James Pratt
eb50c6e198 MDL-43027 core progress : new method keeps track of progress internally 2014-01-27 17:51:09 +07:00
James Pratt
809fdb83b1 MDL-41754 (1) Progress tracking : moved from backup and restore to core 2014-01-27 17:45:50 +07:00
Damyon Wiese
9843e5ece5 MDL-25500 lock: New locking framework.
This locking system is designed to be used everywhere requiring
locking in Moodle. Each use of the locking system can be configured
to use a different type of locking (or the same type with a different
configuration).

The first supported lock types are memcache, memcached, file (flock),
db (specific handlers for pg, mysql and mariadb).
2014-01-27 10:04:18 +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
Michael Aherne
780cf0a728 MDL-43440 unit tests Use correct cm identifier in unit tests 2014-01-25 08:56:43 +11:00
David Monllao
cca6f37389 MDL-43757 behat: Allowing the form field guesser to detect TinyMCE
It includes 2 more minor fixes:
- Escapes values sent to TinyMCE as it was breaking
  when values contained double quotes.
- Adding seconds to the screenshots directory to
  avoid using the same folder for multiple runs.
2014-01-24 15:06:12 +08:00
Dan Poltawski
88de0401ae MDL-33064 tests: remove code_test.php
This test was doing work which doesn't make sense as a unit test.
Perhaps the most sensible option would be to use a git hook. Here is
a replacement David Mudrák created:

$ cat .git/hooks/pre-commit
 #!/bin/bash

FOUND=$(git diff-index --cached -U0 HEAD -- | grep DONOTCOMMIT | wc -l)

if [[ $FOUND -gt 0 ]]; then
    echo "pre-commit hook: DONOTCOMMIT detected, commit not allowed"
    exit 1
fi
2014-01-23 16:03:59 +08:00
Petr Škoda
3345e24f4b MDL-43661 change event property level to edulevel
Level is a reserved word in sql, sorry.
2014-01-21 15:54:56 +08:00
Dan Poltawski
1db62f7ff4 Merge branch 'wip-MDL-41062-master' of git://github.com/marinaglancy/moodle 2014-01-20 15:29:15 +08:00
Marina Glancy
b35ef82f33 MDL-41062 gradebook: corrections to grade_item upgrade script, more tests 2014-01-20 12:26:14 +08:00
Mark Nelson
362b9a0465 MDL-40051 core_lib: replaced add_to_log call when failing to send email with an event 2014-01-19 18:30:40 -08:00
Dan Poltawski
2a9d7a42aa MDL-41062 gradebook: remove sortorder duplicates
* Upgrade function to remove duplicates from the grade item duplicates
  column. Duplicates were causing sorting to fail in some cases.
* Add some unit tests which simulate sort order duplicate data and
  verify that they have been removed.
2014-01-17 17:31:21 +08:00
Dan Poltawski
b19608d682 Merge branch 'MDL-40912_master' of https://github.com/markn86/moodle 2014-01-15 11:41:05 +08:00
Mark Nelson
001f09548d MDL-40912 coursecat: replaced 'hide' and 'show' add_to_log calls with an event 2014-01-14 19:24:15 -08:00
Mark Nelson
d86c7206aa MDL-40912 coursecat: replaced 'move' add_to_log calls with an event 2014-01-14 19:24:14 -08:00
Mark Nelson
c4cea8cb5d MDL-40912 coursecat: replaced 'update' add_to_log call with an event 2014-01-14 19:24:14 -08:00
Mark Nelson
03ea10e6d3 MDL-40912 coursecat: replaced 'add' add_to_log call with an event 2014-01-14 19:24:08 -08:00
David Monllao
4234011a1a MDL-43439 behat: Dir date without - separators 2014-01-15 09:17:44 +08:00