Details

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

      Description

      quick and easy way to enrol users

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            poltawski Dan Poltawski added a comment -

            Integrated, thanks Petr.

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

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

            Thanks!

            Show
            skodak Petr Skoda added a comment - Thanks!
            Hide
            poltawski 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
            poltawski 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
            poltawski Dan Poltawski added a comment -

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

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

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

            Show
            poltawski Dan Poltawski added a comment - Petr, i've edited those docs, if you could verify.
            Hide
            dmonllao 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
            dmonllao 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
            dmonllao 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
            dmonllao 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:
                  Fix Release Date:
                  3/Dec/12