1447 Commits

Author SHA1 Message Date
Marina Glancy
b355a1c97c MDL-50851 core_question: use new tag API 2016-01-10 15:25:47 +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
David Monllao
a49fd98349 MDL-52226 tests: Fix behat phpunit naming conflict 2015-12-21 16:27:23 +08:00
David Monllao
f08d1590c8 Merge branch 'MDL-52226-master' of git://github.com/sammarshallou/moodle 2015-12-21 14:41:21 +08:00
Dan Poltawski
e42b60351e Merge branch 'MDL-52487_master' of git://github.com/dmonllao/moodle 2015-12-14 09:23:03 +00:00
David Monllao
abc4e1efed MDL-52487 rss: PHP 7 compatible error supression
PHP5 used to update error_reporting to 0 on functions called with the
suppress errors operator (@). In PHP7 it is not updated.

Credit to Rajesh Taneja.
2015-12-14 15:28:37 +08:00
David Monllao
05178f0745 Merge branch 'MDL-52471-master' of git://github.com/danpoltawski/moodle 2015-12-11 11:52:02 +08:00
Dan Poltawski
ef5df7b721 MDL-52471 tests: simplify setup code
Test code was not using the generator for simple enrollments, couldn't
help to fix when noticed.
2015-12-10 15:47:11 +00:00
Dan Poltawski
194a02e409 MDL-52471 completion: fix deprecated use of 'object'
And add a unit test covering completion_can_view_data() without
full course object passed.
2015-12-10 15:47:11 +00:00
Dan Poltawski
9708ff95fd MDL-52471 setuplib: depreciate class object properly
Previously was marked depricated but not throwwing debugging
2015-12-10 14:26:30 +00:00
David Monllao
a4fb992435 Merge branch 'MDL-52335-master' of git://github.com/marinaglancy/moodle 2015-12-10 15:47:14 +08:00
sam marshall
6d4858d5b3 MDL-52226 Forms: max_input_vars problems with advanced checkbox 2015-12-09 12:15:45 +00:00
Eloy Lafuente (stronk7)
7955476cab Merge branch 'MDL-51483_master' of https://github.com/jinhofer/moodle 2015-12-09 01:09:08 +01:00
jinhofer
4ebdd15487 MDL-51483 lib/moodlelib.php: Added conditional checks to shorten_text 2015-12-03 10:00:08 -06:00
Dan Poltawski
50901a53bc Merge branch 'MDL-51664-master' of git://github.com/FMCorz/moodle 2015-12-03 11:16:30 +01:00
Dan Poltawski
0ad66dda0e Merge branch 'MDL-52292' of git://github.com/timhunt/moodle 2015-12-03 11:13:26 +01:00
Marina Glancy
83bef8dabb MDL-52335 tool_uploaduser: php7 compatibility in variable syntax 2015-12-03 09:31:25 +08:00
Tim Hunt
eb3884e48f MDL-52292 block testing generators: improve the API
* Refactor the block generator base class, to remove the amount
  of duplication required in base classes.

* Change the defaults that are filled in to be a little more natural.

* Make the Behat step 'Given the following "block" exist:' work.
2015-12-01 13:48:08 +00:00
Dan Poltawski
8fea53a0b1 Merge branch 'MDL-51718-set-scheme' of https://github.com/brendanheywood/moodle 2015-11-30 13:37:47 +00:00
Dan Poltawski
14248189b7 Merge branch 'wip-mdl-50163' of https://github.com/rajeshtaneja/moodle 2015-11-23 11:33:55 +00:00
David Mudrák
182d9990f1 MDL-52214 core: Fix the is_web_crawler() regression
In MDL-50891, the is_web_crawler() was refactored into a core_useragent
method and the function itself was deprecated. However, there were no
unit tests kept to check the backwards compatible behaviour. It turned
out that the deprecated function leads to PHP fatal error due to a typo.

This patch fixes the typo and brings back the previous unit tests. To be
able to explicitly check the raised debugging message, the test case
now must be subclass of advanced_testcase.

Additionally fixes missing info about the function being deprecated.
2015-11-23 09:44:13 +01:00
Rajesh Taneja
8f76de32d9 MDL-50163 behat: Return subcontext from session
Creating a new context with new mink context
with different session was keeping the session
and was not returning proper session information
2015-11-17 13:27:10 +08:00
rajesh Taneja
131d4ac2b0 MDL-50163 behat: Restart session after scenario with switch_window
Restart session after a scenario with switch window
is finished. This will close all open browser windows
and open a new browser window
2015-11-17 12:12:03 +08:00
Dan Poltawski
2759c1218d Merge branch 'MDL-52036-master-resettable' of git://github.com/mudrd8mz/moodle 2015-11-05 09:03:20 +00:00
Brendan Heywood
462065e822 MDL-51718 weblib: Allow moodle_url scheme to be set 2015-11-05 09:08:00 +11:00
David Mudrák
19168d0934 MDL-52036 tablelib: Fix the behaviour of resetting table preferences
The problem with the previous implementation was that the table's
$this->prefs can contain valid non-empty value in its default state -
the default column to sort by. On resetting, we must not throw away
these default prefs.

This patch simplifies the TABLE_VAR_RESET interpretation. If such an
HTTP parameter is passed via the request, the table simply behaves as if
there were no previously stored preferences (does not matter if coming
from the current session, or from the persistent cross-session storage).

The logic that decides on whether or not the reset widget should be
displayed is put into a new method can_be_reset() with unit tests
attached.

Finally, the previously private method render_reset_button() is now
protected and the reset widget is given a new semantic CSS class.
2015-11-04 15:07:17 +01:00
Ryan Wyllie
77b0811021 MDL-51983 actionmenu: behat tests 2015-11-04 06:36:32 +00:00
Eloy Lafuente (stronk7)
217c3e0fc9 Merge branch 'wip-mdl-52007' of https://github.com/rajeshtaneja/moodle 2015-11-03 17:56:23 +01:00
rajesh Taneja
180fdb2f7c MDL-52007 behat: Use extended timeout for site admin expansion 2015-11-03 16:08:27 +08:00
Jun Pataleta
bbbdfc8610 MDL-47073 lib: Replace backslashes with slashes in jquery plugin urls
This patch replaces backslash characters in the generated jQuery
plugin URL to forward slashes when slasharguments is disabled and
 the Moodle server is running on IIS.
Thanks to Ryan Panning <Ryan.Panning@district196.org> for
reporting this issue and for suggesting a fix.
2015-10-30 17:05:23 -05:00
Andrew Nicols
37d0021369 Merge branch 'MDL-51915' of git://github.com/timhunt/moodle 2015-10-29 14:41:45 +08:00
Eloy Lafuente (stronk7)
7c549a17f4 MDL-51893 core_date: Stop using Pacific/Norfolk as 11.5 replacement
Norfolk Island's standard time (NFT) was on UTC+11:30 until 4 October
2015, when it was changed to UTC+11:00. So it's not suitable for 11.5
bad mapping replacement anymore.

It seems that there isn't any other location using such 11.5 timezone
so completely getting rid of it for conversions.
2015-10-27 10:17:05 +01:00
Tim Hunt
42406bc413 MDL-51915 lib tests: Extra unit test for html_to_text. 2015-10-26 18:30:21 +00:00
Dan Poltawski
0a05907873 Merge branch 'MDL-51737-master-3' of git://github.com/andrewnicols/moodle 2015-10-22 14:43:20 +01:00
Andrew Nicols
39a731efb4 MDL-51737 core: Add Edge UserAgent support 2015-10-22 08:37:27 +08:00
Eloy Lafuente (stronk7)
9062fa25ae Merge branch 'MDL-49329-master-multiplug' of git://github.com/mudrd8mz/moodle 2015-10-19 18:10:40 +02:00
David Mudrák
c8a6d162a0 MDL-51832 tests: Fix failing code manager unit tests on Windows 2015-10-19 18:08:59 +02:00
Dan Poltawski
e926ee8cf1 MDL-49329 fixtures: remove trailing whitespace 2015-10-16 15:22:37 +01:00
Dan Poltawski
293197afb3 Merge branch 'MDL-49329-master-multiplug' of git://github.com/mudrd8mz/moodle 2015-10-16 14:53:26 +01:00
Dan Poltawski
05ed945e61 Merge branch 'wip-mdl-50940' of https://github.com/rajeshtaneja/moodle 2015-10-15 08:58:23 +01:00
Andrew Nicols
56bd244634 Merge branch 'MDL-51756-master' of git://github.com/damyon/moodle 2015-10-15 15:22:37 +08:00
Andrew Nicols
8413376088 MDL-51756 tests: Refactor test to use data-provider
The benefit is that this becomes one test per external function instead of one
test testing them all - so more information is shown on failure and we get lots
more dots (we love dots!).
2015-10-15 15:17:02 +08:00
Damyon Wiese
1dc4dc989d MDL-51756 externallib: Show debugging when optional params are wrong
Optional params are not allowed as the top level value for external_function_parameters.
This is because stricter protocols (xmlrpc and soap) cannot handle optional parameters, only
optional properties in a structure.
2015-10-15 14:19:07 +08:00
Frederic Massart
4b11af9607 MDL-51664 external: Validate courses does not refetch prefetched courses 2015-10-12 12:01:15 +08:00
Andrew Nicols
44250050dc MDL-51524 tests: Fix broken tests
The upgraded version of HTML2Text highlighted some bugs in our unit tests.

In the IOS test, the HTML content includes a couple of patches of &nbsp;
In the previous version of HTML2Text, these were being converted to
breaking spaces. In one of these cases, it was then removed due to a trim.
The expected texts have been converted to use the correct non-breaking spaces.
In the case of the trimmed one, it is no longer trimmed as non-breaking
spaces are not trimmed.
This gives a truer reflection of the actual text.

In the case of the Outlook test, this trailing whitespace is not present in
the source. It was likely caused by a bug in the previous version of
HTML2Text.

In the case of the weblib change, the test was just wrong. Both of the
actual characters are encodings for an HTML bullet (decimal and hex) and
should both be converted to the relevant UTF8 representation of this
bullet.
2015-10-12 09:35:59 +08:00
Andrew Nicols
ec2d33dfcd MDL-51524 libraries: Update to latest version of html2text
We were previously using an ancient version of html2text from RoundCube
with many customisations.

This patchset moves to the version included in the latest version of
HTML2Text, and wraps the library in a moodle-provided class. This
moves all previous hacks away from that class.

Unfortunately, two hacks still remain - two of the functions in the
RoundCube class are private, and must be modified to protected in order to
use the class effectively.
2015-10-12 09:35:58 +08:00
David Mudrák
30c264211e MDL-49329 admin: Fix reported coding style warnings 2015-10-10 09:15:27 +02:00
David Mudrák
80c3c6501d MDL-49329 admin: Clean up code manager methods
The method move_plugin_directory() was a relict from previous 2.9
implementation within tool_installadon_installer and was originally
supposed to be used to move whole plugin folders. The archiving feature
has been finally implemented via using zip files (so that we do not have
actual PHP code present in the dataroot) and we do not need this method.
2015-10-09 14:43:33 +02:00
David Mudrák
a2e1e0d0f1 MDL-49329 admin: Archive plugin code before removing it from dirroot
This should allow the admin to revert the upgrade of existing plugins,
such when the dependency chain leads to a dead-end. Additionally, we
archive (as a last-chance copy) the to-be-installed plugins when
cancelling their installation. This is mainly for developers who could
otherwise loose their code. For the same reason, plugins are being
archived upon uninstallation, too.
2015-10-09 14:33:47 +02:00