function RequestSanitizerTest::assertEqualLabelled
Asserts two values are equal, includes a label.
Parameters
mixed $first: The first value to check.
mixed $second: The second value to check.
string $message: The message to display along with the assertion.
string $group: The type of assertion - examples are "Browser", "PHP".
string $label: The label to include with the message.
Return value
bool TRUE if the assertion succeeded, FALSE otherwise.
1 call to RequestSanitizerTest::assertEqualLabelled()
- RequestSanitizerTest::requestSanitizationTest in modules/
simpletest/ tests/ request_sanitizer.test - Tests RequestSanitizer class.
File
-
modules/
simpletest/ tests/ request_sanitizer.test, line 263
Class
- RequestSanitizerTest
- Tests DrupalRequestSanitizer class.
Code
protected function assertEqualLabelled($first, $second, $message = '', $group = 'Other', $label = '') {
$label = empty($label) ? '' : $label . ': ';
$message = $message ? $message : t('Value @first is equal to value @second.', array(
'@first' => var_export($first, TRUE),
'@second' => var_export($second, TRUE),
));
return $this->assert($first == $second, $label . $message, $group);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.