You are here

protected function RequestSanitizerTest::assertEqualLabelled in Drupal 7

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
Tests for the RequestSanitizer class.

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);
}