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

Create default block generator for testing

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
    • MDL-72846-master
    • Hide

      Using generators for blocks that are missing the tests/generator/lib.php files should work, for example:

      Given the following "blocks" exist:
        | blockname | contextlevel | reference | pagetypepattern | defaultregion |
        | html      | Course       | C1        | course-view-*   | site-pre      |
      

      Show
      Using generators for blocks that are missing the tests/generator/lib.php files should work, for example: Given the following "blocks" exist: | blockname | contextlevel | reference | pagetypepattern | defaultregion | | html | Course | C1 | course-view-* | site-pre |

    Description

      At the moment, there are many blocks that are missing a testing generator and trying to create them in a Behat test throws the following error:

      Component block_XXXX does not support generators yet. Missing tests/generator/lib.php

      However, if you try to implement the generator you will find that you only need to extend the testing_block_generator class without implementing any method or adding anything that couldn't be inferred automatically.

      Keeping that in mind, we could provide a default generator for blocks that don't define their own. If any block still needs specific functionality, we can always implement a specific generator to replace the defaults.

      Attachments

        Activity

          People

            noeldemartin Noel De Martin
            noeldemartin Noel De Martin
            Juan Leyva Juan Leyva
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 11 minutes
                2h 11m

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.