. /** * Behat calendar-related steps definitions. * * @package core_calendar * @category test * @copyright 2013 Mark Nelson * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ // NOTE: no MOODLE_INTERNAL used, this file may be required by behat before including /config.php. require_once(__DIR__ . '/../../../lib/behat/behat_base.php'); use Behat\Behat\Context\Step\Given as Given; use Behat\Gherkin\Node\TableNode as TableNode; /** * Contains functions used by behat to test functionality. * * @package core_calendar * @category test * @copyright 2013 Mark Nelson * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class behat_calendar extends behat_base { /** * Create event. * * @Given /^I create a calendar event with form data:$/ * @param TableNode $data * @return array the list of actions to perform */ public function i_create_a_calendar_event_with_form_data($data) { // Get the event name. $eventname = $data->getRow(1); $eventname = $eventname[1]; return array( new Given('I follow "' . get_string('monththis', 'calendar') . '"'), new Given('I click on "' . get_string('newevent', 'calendar') .'" "button"'), new Given('I set the following fields to these values:', $data), new Given('I press "' . get_string('savechanges') . '"'), new Given('I should see "' . $eventname . '"') ); } }