18 Commits

Author SHA1 Message Date
Meirza
b7008d33ea MDL-78167 lib: Added missing class properties in tests
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.

Adding @runTestsInSeparateProcesses and removing setUp() and tearDown() at the
component_test.php, so the test will run in a separate process making sure that
whatever changes happen to the in-memory version of the component class in its thread,
therefore does not impact other tests and makes it more safe.
2023-05-27 09:24:59 +07:00
Paul Holden
af8da7c737 MDL-70070 phpunit: correct data provider method names.
They should not be prefixed `test_` because that's how actual
test methods containing assertions are identified by PHPUnit.
2023-01-16 08:28:37 +00: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
Mihail Geshoski
f0dffddaac MDL-73355 navigation: Add new methods in navigation_node
Adds new methods is_action_link() and action_link_actions() in the
navigation_node class. The is_action_link() method can be used to
check whether the node's action is of type action_link. The
action_link_actions() method returns the formatted data required
for the core/actions template if the navigation node has an action
link.
2022-02-23 21:44:08 +08:00
Mihail Geshoski
73154233e0 MDL-71680 navigation: Add unit tests for set_force_into_more_menu()
- Part of: MDL-69588
2021-08-23 17:46:39 +08:00
Jake Dallimore
5d0cc05b20 MDL-59277 navigation: add support for container type in get_css_type() 2017-09-18 09:03:51 +08:00
James
eb9a3e9379 MDL-53383 navigation: Do not require $type in remove()
navigation_node_collection -> remove function broken when $type is null
2016-03-21 12:16:26 +08:00
Adrian Greeve
508e364f5e MDL-50917 navigation: Unit test for viewing preference page. 2015-09-22 10:57:52 +08:00
Sam Hemelryk
4d5c7cb0d8 MDL-41081 navigation: added unit tests for navbar::prepend 2013-08-26 08:52:35 +12:00
Petr Škoda
c78c8aaad2 MDL-39915 fix core_navigationlib_testcase regression 2013-07-28 15:29:33 +02:00
Petr Škoda
18c4323019 MDL-39915 cleanup core_outputcomponents_testcase 2013-07-27 23:47:54 +02:00
Marina Glancy
5150c30203 MDL-39801 navigation_node::remove does not allow to insert nodes afterwards 2013-05-31 11:49:34 +10:00
Marina Glancy
e3b11a6e2b MDL-39801 navigation_node::remove fails if first child does not have a key 2013-05-31 11:49:12 +10:00
Dan Poltawski
43b5915e04 MDL-37574 - Fix navigation tests: remove title
We are no longer setting it, to improve accessibility
2013-02-05 08:38:32 +08:00
Dan Poltawski
0e35ba6ffc MDL-36357 cleanup - remove double semicolons 2012-11-15 09:51:26 +08:00
Marina Glancy
d0c05602f5 MDL-35263 removed unit test test_format_display_course_content()
since the function global_navigation::format_display_course_content() is removed
2012-10-02 14:16:54 +08:00
Petr Skoda
4ca04fb58b MDL-32569 remove remaining references to simpletest and improve events test 2012-04-21 17:08:30 +02:00
Petr Skoda
f4fd0a13d1 MDL-32149 navigation tests 2012-04-03 22:31:01 +02:00