1. 07 May, 2022 1 commit
    • Eloy Lafuente's avatar
      MDL-73971 phpunit: Move more tests to use correct names and namespaces · 9f53b0e9
      Eloy Lafuente authored
      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
      9f53b0e9
  2. 29 Apr, 2022 1 commit
  3. 23 Apr, 2022 1 commit
  4. 18 Apr, 2022 1 commit
    • Eloy Lafuente's avatar
      MDL-74512 behat: Skip tests requiring lang install/upgrade · 95c8cb75
      Eloy Lafuente authored
      By adding the step:
      
      Given remote langimport tests are enabled
      
      We make the execution of scenarios requiring to install /
      upgrade lang packs optional, based in the existence of the constant:
      
      TOOL_LANGIMPORT_REMOTE_TESTS
      
      That way, when we are skipping language upgrades with the CFG var:
      
      $CFG->skiplangupgrade = true
      
      We can decide not not execute those tests.
      
      With other words, putting something like this in the config.php
      file we will be controlling when to execute or no the behat tests:
      
          // Disable lang updates on upgrade.
          $CFG->skiplangupgrade = true;
          if (empty($CFG->skiplangupgrade)) {
              // Define it only if we aren't skipping lang upgrades.
              define('TOOL_LANGIMPORT_REMOTE_TESTS', true);
          }
      95c8cb75
  5. 13 Apr, 2022 1 commit
  6. 27 Mar, 2022 1 commit
    • Eloy Lafuente's avatar
      MDL-74279 phpunit: Tests using sqlsrv AdoDB must reset settings · 8f414e42
      Eloy Lafuente authored
      AdoDB SQL*Server drivers use to modify some error and
      logging preferences. As far as the connection is shared
      with the main one, that implies that those settings
      remain for the whole remaining execution.
      
      We don't want his in tests, because can affect to other
      tests at distance.
      
      We are fixing this here, only for tests, because it
      doesn't affect normal requests and because, once we
      remove AdoDB this won't be needed anymore.
      8f414e42
  7. 16 Mar, 2022 1 commit
  8. 09 Mar, 2022 1 commit
  9. 22 Feb, 2022 1 commit
  10. 12 Feb, 2022 1 commit
  11. 11 Feb, 2022 3 commits
  12. 08 Feb, 2022 2 commits
  13. 05 Feb, 2022 1 commit
    • Eloy Lafuente's avatar
      MDL-73659 phpunit: restore_date, api, rule, plugin, manager & helper · 7a0d024e
      Eloy Lafuente authored
      All restore_date_test, api_test, rule_test, plugin_test,
      manager_test, helper_test 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:
      
      - All restore_date_test cases have been put under xxx\backup
        level 2 (valid API) namespace.
      7a0d024e
  14. 02 Feb, 2022 2 commits
  15. 28 Jan, 2022 1 commit
  16. 22 Jan, 2022 1 commit
    • Eloy Lafuente's avatar
      MDL-73500 general: Remove php < 73 conditional code · 53003518
      Eloy Lafuente authored
      This commit removes code that only was being executed by php < 73
      and it's 100% safe to do so because Moodle 3.11 and up require
      php 73, hence it was not executed ever.
      
      Removed code includes:
      - ldap_control_paged_result and ldap_control_paged_result_response
        (that were deprecated in php 73 and have been removed in php 80).
      - conditional code in the session manager, where some hacks were
        needed for php < 73. Note that this removes the private function
        append_samesite_cookie_attribute() completely because it was
        doinf nothing (first line was returning for php < 73).
      - Also removed the old session.hash_function ini setting because
        it was removed in php 71.
      
      Kept code includes:
      - The environmental check_igbinary322_version test has not been
        removed because it doesn't hurt (always returns "ok" for php 73
        sites) and doing it would involve to backport the environment.xml
        file to 39 and 310. Instead, a note has been added to MDL-71747
        in order to get rid of that check for 4.1 and up.
      53003518
  17. 14 Jan, 2022 1 commit
    • Eloy Lafuente's avatar
      MDL-73476 phpunit: events, external and search tescase names · 0c53a3de
      Eloy Lafuente authored
      All events_test, external_test and search_test classes:
      
      - Namespaced with component[\level2-API]
      - Moved to level2-API subdirectory when required.
      - Fixed incorrect use statements with leading backslash.
      - 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 lib/external/tests/external_test.php:
      - external is not a valid component
      - hence, its only valid namespace is "core"
      - also, it's testing lib/external/externallib.php
      - hence, the file (and class) have been renamed to external_externallib_test.php
        (to avoid conflicts with other external_test that may exist in core)
      0c53a3de
  18. 13 Jan, 2022 1 commit
  19. 04 Jan, 2022 1 commit
  20. 20 Dec, 2021 1 commit
  21. 17 Dec, 2021 2 commits
    • Eloy Lafuente's avatar
      MDL-73348 phpunit: normalize all privacy provider tests · e4a2d9c1
      Eloy Lafuente authored
      As far as now all them have correct privacy level2 namespace:
      - Move them to "privacy" subdir.
      - Rename the files to "provider_test.php", this includes old
        privacy_test.php and privacy_provider_test.php files
      - Rename the testcase to provider_test too (to match file name)
      
      Also, change some relative paths and comments to point to new
      locations.
      e4a2d9c1
    • Eloy Lafuente's avatar
      MDL-73348 phpunit: privacy and privacy_provider testcase names · 57e6fb7a
      Eloy Lafuente authored
      All privacy_test and privacy_provider_test classes:
      
      - Namespaced with component\privacy.
      - Fixed incorrect use statements with leading backslash.
      - Changed code to point to global scope when needed.
      - Renamed a few files to make all be privacy_test or privacy_provider_test.php
      - All them passing individually.
      - Complete runs passing too.
      57e6fb7a
  22. 13 Dec, 2021 1 commit
  23. 03 Dec, 2021 1 commit
  24. 01 Dec, 2021 1 commit
  25. 19 Oct, 2021 3 commits
  26. 16 Sep, 2021 5 commits
  27. 13 Sep, 2021 1 commit
  28. 08 Sep, 2021 1 commit
  29. 07 Sep, 2021 1 commit