Merge branch 'MDL-43236_25' of git://github.com/dmonllao/moodle into MOODLE_25_STABLE

This commit is contained in:
Dan Poltawski
2014-03-10 12:04:17 +08:00
3 changed files with 58 additions and 4 deletions
+17
View File
@@ -136,6 +136,23 @@ class behat_data_generators extends behat_base {
/**
* Creates the specified element. More info about available elements in http://docs.moodle.org/dev/Acceptance_testing#Fixtures.
*
* This method has been introduced in 2.7 and replaces self::the_following_exists(),
* it has been added here to make backports easier and to help 3rd parties working on new
* scenarios so they don't need to update their scenarios when they upgrade to 2.7.
*
* @Given /^the following "(?P<element_string>(?:[^"]|\\")*)" exist:$/
*
* @param string $elementname The name of the entity to add
* @param TableNode $data
*/
public function the_following_exist($elementname, TableNode $data) {
// Forwarding it.
$this->the_following_exists($elementname, $data);
}
/**
* Creates the specified element. More info about available elements in http://docs.moodle.org/dev/Acceptance_testing#Fixtures. This step will be deprecated in Moodle 2.7 in favour of 'the following "ELEMENT_STRING" exist:'.
*
* @Given /^the following "(?P<element_string>(?:[^"]|\\")*)" exists:$/
*
* @throws Exception
+3 -3
View File
@@ -84,7 +84,7 @@ class behat_forms extends behat_base {
}
/**
* Fills a moodle form with field/value data.
* Fills a moodle form with field/value data. This step will be deprecated in Moodle 2.7 in favour of 'I set the following fields to these values:'.
*
* @Given /^I fill the moodle form with:$/
* @throws ElementNotFoundException Thrown by behat_base::find
@@ -186,7 +186,7 @@ class behat_forms extends behat_base {
}
/**
* Fills in form text field with specified id|name|label|value. It works with text-based fields.
* Fills in form text field with specified id|name|label|value. It works with text-based fields. This step will be deprecated in Moodle 2.7 in favour of 'I set the field "FIELD_STRING" to "VALUE_STRING"'.
*
* @When /^I fill in "(?P<field_string>(?:[^"]|\\")*)" with "(?P<value_string>(?:[^"]|\\")*)"$/
* @throws ElementNotFoundException Thrown by behat_base::find
@@ -243,7 +243,7 @@ class behat_forms extends behat_base {
}
/**
* Checks that the field matches the specified value. When using multi-select fields use commas to separate selected options.
* Checks that the field matches the specified value. When using multi-select fields use commas to separate selected options. This step will be deprecated in Moodle 2.7 in favour of 'the field "FIELD_STRING" matches value "VALUE_STRING"'.
*
* @Then /^the "(?P<field_string>(?:[^"]|\\")*)" field should match "(?P<value_string>(?:[^"]|\\")*)" value$/
* @throws ExpectationException
+38 -1
View File
@@ -526,7 +526,25 @@ class behat_general extends behat_base {
/**
* Checks the provided element and selector type exists in the current page.
*
* This step is for advanced users, use it if you don't find anything else suitable for what you need.
* This method has been introduced in 2.7 and replaces self::should_exists(),
* it has been added here to make backports easier and to help 3rd parties working on new
* scenarios so they don't need to update their scenarios when they upgrade to 2.7.
*
* @Then /^"(?P<element_string>(?:[^"]|\\")*)" "(?P<selector_string>[^"]*)" should exist$/
*
* @param string $element The locator of the specified selector
* @param string $selectortype The selector type
*/
public function should_exist($element, $selectortype) {
// Forwarding it.
$this->should_exists($element, $selectortype);
}
/**
* Checks the provided element and selector type exists in the current page. This step will be deprecated in Moodle 2.7 in favour of '"ELEMENT_STRING" "SELECTOR_STRING" should exist'.
*
* This step is for advanced users, use it if you don't find
* anything else suitable for what you need.
*
* @Then /^"(?P<element_string>(?:[^"]|\\")*)" "(?P<selector_string>[^"]*)" should exists$/
* @throws ElementNotFoundException Thrown by behat_base::find
@@ -545,6 +563,25 @@ class behat_general extends behat_base {
/**
* Checks that the provided element and selector type not exists in the current page.
*
* This step is for advanced users, use it if you don't find
* anything else suitable for what you need.
*
* This method has been introduced in 2.7 and replaces self::should_not_exists(),
* it has been added here to make backports easier and to help 3rd parties working on new
* scenarios so they don't need to update their scenarios when they upgrade to 2.7.
*
* @Then /^"(?P<element_string>(?:[^"]|\\")*)" "(?P<selector_string>[^"]*)" should not exist$/
* @param string $element The locator of the specified selector
* @param string $selectortype The selector type
*/
public function should_not_exist($element, $selectortype) {
// Forwarding it.
$this->should_not_exists($element, $selectortype);
}
/**
* Checks that the provided element and selector type not exists in the current page. This step will be deprecated in Moodle 2.7 in favour of '"ELEMENT_STRING" "SELECTOR_STRING" should not exist'.
*
* This step is for advanced users, use it if you don't find anything else suitable for what you need.
*
* @Then /^"(?P<element_string>(?:[^"]|\\")*)" "(?P<selector_string>[^"]*)" should not exists$/