19 Commits

Author SHA1 Message Date
danghieu1407
173da3666c MDL-78556 tablelib: flexible_table should support caption tag 2023-07-11 14:18:54 +07:00
Shamim Rezaie
e29007d679 MDL-68550 output: Improve accessibility of the paging bar
The use of aria-current is based on the example at
https://design-system.w3.org/components/pagination.html
2022-11-10 06:06:02 +11:00
Eloy Lafuente (stronk7)
83b490a594 MDL-75111 phpunit: Move tests to use correct names and ns (take#4)
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:

- The following task tests have been moved within the level2 directory:
  - \core\adhoc_task_test => \core\task\adhoc_task_test
  - \core\scheduled_task_test => \core\task\scheduled_task_test
  - \core\calendar_cron_task_test => \core\task\calendar_cron_task_test
  - \core\h5p_get_content_types_task_test => \core\task\h5p_get_content_types_task_test
  - \core\task_database_logger_test => \core\task\database_logger_test
  - \core\task_logging_test => \core\task\logging_test

- The following event tests have been moved within level2 directory:
  - \core\event_context_locked_test => \core\event\context_locked_test
  - \core\event_deprecated_test => \core\event\deprecated_test
  - \core\event_grade_deleted_test => \core\event\grade_deleted_test
  - \core\event_profile_field_test => \core\event\profile_field_test
  - \core\event_unknown_logged_test => \core\event\unknown_logged_test
  - \core\event_user_graded_test => \core\event\user_graded_test
  - \core\event_user_password_updated_test => \core\event\user_password_updated_test

- The following output tests have been moved within level2 directory:
  - \core\mustache_template_finder_test => \core\output\mustache_template_finder_test
  - \core\mustache_template_source_loader_test => \core\output\mustache_template_source_loader_test
  - \core\output_mustache_helper_collection_test => \core\output\mustache_helper_collection_test

- The following tests have been moved to their correct tests directories:
  - lib/tests/time_splittings_test.php => analytics/tests/time_splittings_test.php

- All the classes and tests under lib/filebrowser and lib/filestorage
  belong to core, not to core_files. Some day we should move
  them to their correct subsystem.
- All the classes and tests under lib/grade belong to core, not
  to core_grades. Some day we should move them to their correct
  subsystem.
- The core_grades_external class and its \core\grades_external_test
  unit test should belong to the grades subsystem or, alternatively,
  to \core\external, they both should be moved together.
- The core_grading_external class and its \core\grading_external_test
  unit test should belong to the grading subsystem or, alternatively,
  to \core\external, they both should be moved together.
- The \core\message\message and \core\message\inbound (may be others)
  classes, and their associated tests should go to the core_message
  subsystem.
- The core_user class, and its associated tests should go to the
  core_user subsystem.
- The \core\update namespace is plain wrong (update is not valid API)
  and needs action 1) create it or 2) move elsewhere.
2022-08-26 16:34:20 +02:00
Luca Bösch
19d7c11b60 MDL-71373 core_enrol: localize "close" in role manager. 2021-05-14 14:18:52 +02:00
Eloy Lafuente (stronk7)
ba5b6089d5 MDL-71036 phpunit: Renamed various regexp-related assertions
In PHPUnit 9.1, the following regexp-related assertions
have been deprecated and there are new alternatives for
all them:
    - assertRegExp()     -> assertMatchesRegularExpression()
    - assertNotRegExp()  -> assertDoesNotMatchRegularExpression()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

    ag 'assertRegExp|assertNotRegExp' -li
2021-03-11 19:22:24 +01:00
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
Andrew Nicols
c540a575db MDL-68286 table: Support initials bar for dynamic tables 2020-04-03 16:54:13 +08:00
Jake Dallimore
050f048e26 Merge branch 'MDL-66659' of https://github.com/paulholden/moodle 2019-10-14 15:33:10 +08:00
Paul Holden
d99bbd8e80 MDL-66659 core: observe viewfullnames capability in flexible_table. 2019-10-01 10:07:29 +01:00
Marina Glancy
b51bfaf594 MDL-65919 core: add test for table download 2019-09-30 12:00:37 +02:00
Paul Holden
821614d87c MDL-64784 core: update tablelib tests for explicit sort direction. 2019-04-05 11:53:33 +01:00
Bas Brands
4f9d62835a MDL-62347 course: pagination phpunit updates 2018-08-13 13:45:33 +02: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
Tony Butler
60ec267b0b MDL-45725 core_lib: Add unit test for persistent flexible tables 2015-03-16 10:41:11 +00:00
Frederic Massart
ba55be9151 MDL-43902 output: Final deprecation of classes r0/r1 in table rows 2014-12-09 14:52:30 +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
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
Damyon Wiese
3e22717283 MDL-42112 tablelib: Generate the correct number of cols for empty rows
(And a test for it).
2013-10-18 11:51:55 +08:00
Damyon Wiese
306b31794a MDL-42112 Tablelib: Add unit tests (some) 2013-10-18 11:47:07 +08:00