Hello,
I try to create a phpunit test for a new type of question whose answer is a dropped file.
Unfortunately, I can not simulate this answer because the answer is as expected class type question_file_loader.
Just for information, we use the code proposed in this patch:
https://tracker.moodle.org/browse/MDL-34640
In fact, it is much easier to insert a response with the string type.
I absolutely need to simulate the response Asserts in phpunit.
Normally, I could use in example the unit test from essay type question since it is possible to accept files as a response in this type of question. Unfortunately, the tests do not include attachments. (attachments=0 in tests).
How can I take a file from my tests folder, temporarely put it in the moodle file environment, with a contextid, a hash, a database entries etc. generate my question_file_loader object with it and then delete the file entry.
Thank you for helping me.