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

POLICY: How to deprecate Behat step definitions

XMLWordPrintable

    • MOODLE_26_STABLE

      We come to the point when we need to get rid of some Behat step definitions.

      Examples:

      • Step is not named correctly and needs renaming
      • Step is too particular and should basically do the same just have one more argument.
      • There are already two steps doing almost the same and one can easily be substituted with another.

      We should apply the same rules for deprecation (add @deprecated since tag in phpdocs, remove after 2 releases) but we can't display debugging messages from inside of behat features.

      Policy:

      When step definition needs to be deprecated, do the following:

      1. Move the deprecated step definition to lib/tests/behat/behat_deprecated.php (this file was created as part of MDL-42627)
      2. In the beginning of deprecated function make sure to call $this->deprecated_message($alternatives). DO NOT throw exception or display debugging notices.
      3. Add @deprecated since, @see tags to this function phpdocs and create issue to remove this function after 2 major releases as usual, see http://docs.moodle.org/dev/Deprecation (not necessary to create more than one issue per major version)

            Unassigned Unassigned
            marina Marina Glancy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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