36 Commits

Author SHA1 Message Date
Paul Holden
3bfb7f759a
MDL-76838 backup: remove invalid utf8 code sequences writing XML.
The surrogate blocks FFFE and FFFF are non-characters, specifically
disallowed in the character range for XML documents.
2023-05-22 21:04:02 +01:00
Meirza
8a5485a714 MDL-77338 backup: Added class properties that are not declared.
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-04-03 22:39:39 +07:00
Andrew Nicols
7000a99de3 MDL-76362 core: Coding style fixes 2023-01-23 09:15:55 +08:00
Marina Glancy
b0a83aa7bd MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:15:54 +08:00
Eloy Lafuente (stronk7)
9f53b0e965 MDL-73971 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- Some fixtures, initially defined in the test files have been
  moved to new files in fixtures subdirectory, leaving the unit
  test files clearer:
  - moodle2_course_format_test.php
- Rename wrong named test:
  - baseoptiogroup_test = baseoptigroup_test
2022-05-06 18:29:11 +02: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
Russell Smith
92996836d0 MDL-41674 backup: Use a trie for grouped path detection. 2015-01-11 12:54:32 +11:00
James Pratt
809fdb83b1 MDL-41754 (1) Progress tracking : moved from backup and restore to core 2014-01-27 17:45:50 +07:00
sam marshall
4fb31ae6cd MDL-41669 Restore: Progress bar needs to include more tasks
1. Changes progress bar code to allow headings for progress bar (so users have
   some clue what's going on if a page has more than one progress bar).
2. Changes restore code so that a progress bar can display during pre-checks if
   they take longer than 5 seconds.
3. Changes pre-check and restore code so that, in various points where the system
   can take a long time within an individual step, intederminate progress is
   indicated and it won't time out.
2013-09-16 17:18:12 +01:00
Dan Poltawski
a0035108b0 MDL-40585 fix trailing whitespace 2013-07-23 13:33:49 +08:00
Russell Smith
f27cb59c36 MDL-40585 backup: cache XML parent paths
For $this->groupedpaths, using a key is faster as there is
no need to do in_array searches.

Parent cache allows dirname calls to be substantially reduced.
2048 was chosen as a cache size as this class operates on chunks
of the restore at a time, 8k questions produces a parent cache of
about 500 paths and uses 300K of memory.  Scaling up to 2048 will
use about 1.2M of RAM for really large restores.  This is acceptable
for the 48% function call reduction and the 10% runtime improvement
seen.
2013-07-15 15:07:35 +10:00
Eloy Lafuente (stronk7)
a3cdb2ba7e MDL-37893 Take rid of old comment. 2013-02-12 10:03:29 +01:00
Eloy Lafuente (stronk7)
b57f62c497 Merge branch 'MDL-37893-grouped-empty' of git://github.com/mudrd8mz/moodle 2013-02-12 10:02:23 +01:00
Eloy Lafuente (stronk7)
43b83ea19e MDL-37893 Always notify pending starts before dispatching chunk 2013-02-07 20:59:43 +01:00
David Mudrák
2c06c715c7 MDL-37893 Allow elements with no final tags to form a grouped path 2013-02-07 13:00:19 +01:00
David Mudrák
98bba46b70 MDL-37893 Add unit test to demonstrate the issue 2013-02-07 13:00:18 +01:00
David Mudrák
5aeff5ebc0 MDL-37870 Fix the number of parameters when calling the parent constructor 2013-02-05 04:47:41 +01:00
Dan Poltawski
0e35ba6ffc MDL-36357 cleanup - remove double semicolons 2012-11-15 09:51:26 +08:00
Petr Skoda
bb7898c6ab MDL-32569 convert remaining backup tests and drop old simpletests 2012-04-21 16:24:33 +02:00
Petr Skoda
4b02743182 MDL-32149 improve testcase naming and list in config file 2012-04-03 22:30:57 +02:00
Petr Skoda
4ac88d6d10 MDL-32149 remaining phpunit tests for backup/restore 2012-04-03 22:30:55 +02:00
Tom Lanyon
7aa06e6ded MDL-28701 Change all uses of $CFG->dataroot/temp to $CFG->tempdir 2011-09-10 10:35:39 +02:00
Eloy Lafuente (stronk7)
d4dd06591b MDL-27594 backup - out unused (and incorrect) condition + stronger tests 2011-05-24 11:55:39 +02:00
Eloy Lafuente (stronk7)
54b8f33421 MDL-27594 backup - fix start/end notifications on empty chunks 2011-05-23 00:58:45 +02:00
Eloy Lafuente (stronk7)
8298bedab7 MDL-27475 backup - fix start/end notifications order + tests 2011-05-11 20:01:13 +02:00
Eloy Lafuente (stronk7)
14e6710d99 MDL-26896 parser - add start/end path notifications 2011-04-11 02:16:58 +02:00
Petr Skoda
431ac39634 MDL-26623 fix file permissions
The permissions are now going to be verified as part of the weekly release process.
2011-03-01 12:26:49 +01:00
Eloy Lafuente (stronk7)
5539e69862 MDL-26229 restore - parser improvements (repetitions and skipped tags) 2011-02-12 02:19:02 +01:00
Sam Marshall
1865b411fd Backup MDL-24906 Fixed unit test failures 2010-11-01 14:46:07 +00:00
Eloy Lafuente
e521039d22 MDL-24381 backup - avoid infinite iteration under windows caused by platform-dependent dirname() 2010-09-28 21:26:11 +00:00
Eloy Lafuente
f35de25886 MDL-23796 backup - improve parser to discard whitespace-empty tags 2010-08-24 14:07:31 +00:00
David Mudrak
2d3522ae1e NOMDL Fixed incorrect throwing of exceptions - missing 'new' or unknown exception class 2010-07-18 12:30:49 +00:00
Eloy Lafuente
dc5a2f8a5a MDL-21432 backup - using grouped parser in moodle_backup.xml + minor changes in common stuff 2010-07-05 22:10:51 +00:00
Eloy Lafuente
4c7f6ac693 MDL-22699 restore parser - new grouped parser, useful for multilevel tags 2010-07-05 00:50:06 +00:00
Eloy Lafuente
be866f9d6c MDL-22699 xml parser - to be used by restore 2010-06-07 14:40:12 +00:00
Eloy Lafuente
69dd0c8cbf MDL-21432 backup 2.0 - initial commit. util dir 2010-04-21 09:17:06 +00:00