MDL-72125 testing: Set a default idnumber when creating activities
commit7cd408501b3db0cfe706b951af9f3fdc81d60440
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 8 Jul 2021 03:50:17 +0000 (8 11:50 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Fri, 16 Jul 2021 04:33:56 +0000 (16 12:33 +0800)
tree734ad96be04d813069e27c68fd30f6756729bd66
parentdaf9b24b6a8e76ecd71116bb4e9f2da72361245a
MDL-72125 testing: Set a default idnumber when creating activities

The activity generator currently requires an idnumber when creating
activities, but this is not a requirement when creating the same
activity through the UI. The requirement comes because we want to
provide a way to refer to activities in subsequent steps.

This commit modifies the behaviour such that the generator uses the name
of the activity as the default idnumber.

This has two  main benefits:
1. it simplfies generation of activities; and
2. it makes the language used when writing behat tests much more natural.

With this change, steps will refer to the activity by its idnumber/title
in all cases, rather than sometimes by an idnumber which bears no
relevance to the title.
lib/behat/classes/behat_core_generator.php