Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-61985

Function get_component_classes_in_namespace doesn't return the right class path as value

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.3.5, 3.4.2, 3.5
    • Fix Version/s: None
    • Component/s: General
    • Labels:
      None
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE

      Description

      When I was working in implements privacy for tool_mobile (MDL-61944) and I was checking an error in a general test, I can see a wrong class path in the return array with a print_object:

      print_object(core_component::get_component_classes_in_namespace('tool_mobile', ''));

      Result:

        ...
          [tool_mobile\privacy\provider] => Array
              (
                  [0] => tool_mobile\
              )
      ...
      

      When I was expecting this:

        ...
          [tool_mobile\privacy\provider] => Array
              (
                  [0] => tool_mobile\privacy
              )
      ...
      

      You can test it easly in this branch MDL-61944 editing lib/tests/component_test.php and add this print_object inside test_get_component_classes_int_namespace() and then launch:
      vendor/bin/phpunit --verbose core_component_testcase lib/tests/component_test.php

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              cescobedo Carlos Escobedo
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: