Affects Version/s: 3.4.5, 3.5.2
Fix Version/s: None
Component/s: Automated functional tests (behat)
Affected Branches:MOODLE_34_STABLE, MOODLE_35_STABLE
Currently we have a very limited Behat step:
Then following "click here" should download between "1000" and "1200" bytes
It was created by sam marshall and added to standard Moodle by Tim Hunt. At the time was the only think they could think of to allow some sort of test of downloads - just a basic test that the download gave something, not an error.
If you look at the implementation of the current step, it just uses download_file_content on the URL from the link followed, then just tests strlen($result).
However, that means it would not be hard to implement better tests. I am thinking of a step like:
What do people think about that proposed form? (The idea is that it would be quite easy to add more tests later as we find we need them, and the last two there are, as already said, pretty useless, so are only really there for backwards compatibility.)
I probably won't have time to work on this any time soon, so I would be delighed if someone else took it.