summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJennifer Hodgdon2014-06-17 15:43:47 (GMT)
committerJennifer Hodgdon2014-06-17 15:43:47 (GMT)
commit4a13614a2ae82d093c5f3661df39070b5a5af558 (patch)
treef0c9182bd4291ae27758a9ac335b8b65f7aac896
parent7ad74a99a22e232a088f12aff1e6a28a96edcdde (diff)
Issue #2039449 by joshi.rohit100, joachim, lokapujya, Jalandhar, paulh, yaworsk: Fix docs for assertField methods in WebTestBase to describe how to skip value checking
-rw-r--r--core/modules/simpletest/src/WebTestBase.php58
1 files changed, 36 insertions, 22 deletions
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index 347ddb3..9bf6c23 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -404,7 +404,7 @@ abstract class WebTestBase extends TestBase {
* @endcode
* The following defaults are provided:
* - label: Random string.
- * - id: Random string.
+ * - ID: Random string.
* - region: 'sidebar_first'.
* - theme: The default theme.
* - visibility: Empty array.
@@ -3147,7 +3147,9 @@ abstract class WebTestBase extends TestBase {
* @param $xpath
* XPath used to find the field.
* @param $value
- * (optional) Value of the field to assert.
+ * (optional) Value of the field to assert. You may pass in NULL (default)
+ * to skip checking the actual value, while still checking that the field
+ * exists.
* @param $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not
@@ -3222,12 +3224,13 @@ abstract class WebTestBase extends TestBase {
}
/**
- * Asserts that a field does not exist in the current page by the given XPath.
+ * Asserts that a field doesn't exist or its value doesn't match, by XPath.
*
* @param $xpath
* XPath used to find the field.
* @param $value
- * (optional) Value of the field to assert.
+ * (optional) Value for the field, to assert that the field's value on the
+ * page doesn't match it.
* @param $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not
@@ -3265,7 +3268,9 @@ abstract class WebTestBase extends TestBase {
* @param $name
* Name of field to assert.
* @param $value
- * Value of the field to assert.
+ * (optional) Value of the field to assert. You may pass in NULL (default)
+ * to skip checking the actual value, while still checking that the field
+ * exists.
* @param $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not
@@ -3302,7 +3307,10 @@ abstract class WebTestBase extends TestBase {
* @param $name
* Name of field to assert.
* @param $value
- * Value of the field to assert.
+ * (optional) Value for the field, to assert that the field's value on the
+ * page doesn't match it. You may pass in NULL to skip checking the
+ * value, while still checking that the field doesn't exist. However, the
+ * default value ('') asserts that the field value is not an empty string.
* @param $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not
@@ -3321,12 +3329,15 @@ abstract class WebTestBase extends TestBase {
}
/**
- * Asserts that a field exists with the given id and value.
+ * Asserts that a field exists with the given ID and value.
*
* @param $id
- * Id of field to assert.
+ * ID of field to assert.
* @param $value
- * Value of the field to assert.
+ * (optional) Value for the field to assert. You may pass in NULL to skip
+ * checking the value, while still checking that the field exists.
+ * However, the default value ('') asserts that the field value is an empty
+ * string.
* @param $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not
@@ -3345,12 +3356,15 @@ abstract class WebTestBase extends TestBase {
}
/**
- * Asserts that a field does not exist with the given id and value.
+ * Asserts that a field does not exist with the given ID and value.
*
* @param $id
- * Id of field to assert.
+ * ID of field to assert.
* @param $value
- * Value of the field to assert.
+ * (optional) Value for the field, to assert that the field's value on the
+ * page doesn't match it. You may pass in NULL to skip checking the value,
+ * while still checking that the field doesn't exist. However, the default
+ * value ('') asserts that the field value is not an empty string.
* @param $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not
@@ -3372,7 +3386,7 @@ abstract class WebTestBase extends TestBase {
* Asserts that a checkbox field in the current page is checked.
*
* @param $id
- * Id of field to assert.
+ * ID of field to assert.
* @param $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not
@@ -3395,7 +3409,7 @@ abstract class WebTestBase extends TestBase {
* Asserts that a checkbox field in the current page is not checked.
*
* @param $id
- * Id of field to assert.
+ * ID of field to assert.
* @param $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not
@@ -3418,7 +3432,7 @@ abstract class WebTestBase extends TestBase {
* Asserts that a select option in the current page exists.
*
* @param $id
- * Id of select field to assert.
+ * ID of select field to assert.
* @param $option
* Option to assert.
* @param $message
@@ -3443,7 +3457,7 @@ abstract class WebTestBase extends TestBase {
* Asserts that a select option in the current page does not exist.
*
* @param $id
- * Id of select field to assert.
+ * ID of select field to assert.
* @param $option
* Option to assert.
* @param $message
@@ -3469,7 +3483,7 @@ abstract class WebTestBase extends TestBase {
* Asserts that a select option in the current page is checked.
*
* @param $id
- * Id of select field to assert.
+ * ID of select field to assert.
* @param $option
* Option to assert.
* @param $message
@@ -3496,7 +3510,7 @@ abstract class WebTestBase extends TestBase {
* Asserts that a select option in the current page is not checked.
*
* @param $id
- * Id of select field to assert.
+ * ID of select field to assert.
* @param $option
* Option to assert.
* @param $message
@@ -3518,10 +3532,10 @@ abstract class WebTestBase extends TestBase {
}
/**
- * Asserts that a field exists with the given name or id.
+ * Asserts that a field exists with the given name or ID.
*
* @param $field
- * Name or id of field to assert.
+ * Name or ID of field to assert.
* @param $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not
@@ -3540,10 +3554,10 @@ abstract class WebTestBase extends TestBase {
}
/**
- * Asserts that a field does not exist with the given name or id.
+ * Asserts that a field does not exist with the given name or ID.
*
* @param $field
- * Name or id of field to assert.
+ * Name or ID of field to assert.
* @param $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not