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

New APIs for generators, behat stuff... or no. And autoloading for them

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6.6, 3.7, 3.8
    • Fix Version/s: None
    • Component/s: Unit tests
    • Labels:
      None
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE

      Description

      With MDLSITE-4800 decided now we can start using namespaces within **/tests directories in an organized way

      There are various stuff that can be found there:

      • phpunit test cases.
      • generators.
      • fixtures.
      • behat steps
      • ...

      Given the agreement about namespaces... maybe we should consider to make the proper APIs, so they can be used as level2 namespace (\mod_forum\generator\...).

      Alternative (not needing them being APIs) would be to move the to 3rd level, under local, where we have freedom. (\mod_forum\local\generators)

      And also, there is the already existing "tests" API, so we can use it too (\mod_forum\tests\generator).

      Note it's not mandatory to move all them to namespaces, neither implement their autoloading. But we need to provide/allow the details the agreement defines.

      So this is about consider which alternative we follow and how we provide autoloading for them. Importantly... test cases themselves don't need autoloading (phpunit's finder finds them no matter the namespace).

      Ciao

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: