Thanks a lot, Itamar. That was the method I was looking for.
Did you find that method in a documentation or did you discover it digging in Moodle code?
Thanks a lot, Itamar. That was the method I was looking for.
Did you find that method in a documentation or did you discover it digging in Moodle code?
Given the Behat rule file "local/more_rules/tests/behat/behat_local_core_rules.php" and the generator file "local/more_rules/tests/generator/lib.php".
The rules class is build with
class behat_local_more_rules extends behat_base {}
The generator class is build with
class local_more_rules_generator extends testing_data_generator {}
To be able to call the generator methods I need the reference to the generator class. In "lib/tests/behat/behat_data_generators.php" I found the line that gets the datagenerator
$this->datagenerator = testing_util::get_data_generator();
When I call the same line in my rules script I get an error. My solution for now is to hard code the connection to the generator with
require_once(__DIR__.'/../generator/lib.php');
$this->generator = new local_more_rules_generator();
This code works but I hope there might be a more general solution.
Given the file "local/more_rules/tests/behat/behat_local_more_rules.php" with a bug.
How can I configure the server (I use the PHP buildin webserver) or Behat to initialize a remote debugging session.
I tried to add the XDebug start parameter to the behat_wwwroot URL which started the debug session but broke the Behat process.
Thank you Itamar for the explanation. I thought "rexrules" might be a special name - I associated the name with REGEX
David, I try to understand your feedback - can you please explain why you call the proposed feature "rexrules"? I guess the name has a meaning but I don't understand it may be important.