Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: Unit tests
    • Labels:
    • Rank:
      46206

      Description

      quick and easy way to enrol users

        Issue Links

          Activity

          Hide
          Dan Poltawski added a comment -

          Integrated, thanks Petr.

          This can be passed once its been added to the phpunit docs.

          Show
          Dan Poltawski added a comment - Integrated, thanks Petr. This can be passed once its been added to the phpunit docs.
          Show
          Petr Škoda added a comment - Documented at http://docs.moodle.org/dev/Writing_PHPUnit_tests#Simplified_user_enrolments
          Hide
          Petr Škoda added a comment -

          Thanks!

          Show
          Petr Škoda added a comment - Thanks!
          Hide
          Dan Poltawski added a comment -

          Congratulations! Another bug solved.. only another 7330 to go, thanks for contributing to contributing to 0.8% of all bugs being fixed this week!

          ciao
          Dan

          Show
          Dan Poltawski added a comment - Congratulations! Another bug solved.. only another 7330 to go, thanks for contributing to contributing to 0.8% of all bugs being fixed this week! ciao Dan
          Hide
          Dan Poltawski added a comment -

          Well, my 'testing' of these docs was crap, you're docs look completely wrong to me, editing!

          Show
          Dan Poltawski added a comment - Well, my 'testing' of these docs was crap, you're docs look completely wrong to me, editing!
          Hide
          Dan Poltawski added a comment -

          Petr, i've edited those docs, if you could verify.

          Show
          Dan Poltawski added a comment - Petr, i've edited those docs, if you could verify.
          Hide
          David Monllaó added a comment -

          Hi Petr,

          What's your opinion about using a standard interface when adding new generators? I mean something very simple like create_$entityname($record) with a flexible return; this has been done like this until enrol_user($userid, $courseid, $roleid, $enrol), this would make life easier from the Behat side when adding fixtures of different entities http://docs.moodle.org/dev/Acceptance_testing#Available_elements, in fact having a standard create_$entityname($record) all is managed by a single generic adapter to the data generators class methods otherwise every entity requires a different adapter. The only good point I see with the way enrol_user is defined is that you don't need to read the function/phpDoc block to know which params are required and which aren't and that it has already been integrated in 2.4

          Show
          David Monllaó added a comment - Hi Petr, What's your opinion about using a standard interface when adding new generators? I mean something very simple like create_$entityname($record) with a flexible return; this has been done like this until enrol_user($userid, $courseid, $roleid, $enrol), this would make life easier from the Behat side when adding fixtures of different entities http://docs.moodle.org/dev/Acceptance_testing#Available_elements , in fact having a standard create_$entityname($record) all is managed by a single generic adapter to the data generators class methods otherwise every entity requires a different adapter. The only good point I see with the way enrol_user is defined is that you don't need to read the function/phpDoc block to know which params are required and which aren't and that it has already been integrated in 2.4
          Hide
          David Monllaó added a comment -

          Just in case I haven't explain it correctly For example create_enrol_user($record) (where record must contain userid, courseid, roleid and enrol) could be better than having enrol_user($userid, $courseid, $roleid, $enrol) and the same for future new entities like create_whatever($record) instead of what_ever_each_different($arg1, $arg2)

          Show
          David Monllaó added a comment - Just in case I haven't explain it correctly For example create_enrol_user($record) (where record must contain userid, courseid, roleid and enrol) could be better than having enrol_user($userid, $courseid, $roleid, $enrol) and the same for future new entities like create_whatever($record) instead of what_ever_each_different($arg1, $arg2)

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: