You are here

protected function ContentHubSubscriberTestBase::assertResponseBody in Acquia Content Hub 8

Check if the HTTP request response body is identical to the expected value.

Parameters

string $expected: The first value to check.

string $message: (optional) A message to display with the assertion. Do not translate messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed variables in the message text, not t(). If left blank, a default message will be displayed.

string $group: (optional) The group this message is in, which is displayed in a column in test output. Use 'Debug' to indicate this is debugging output. Do not translate this string. Defaults to 'Other'; most tests do not override this default.

Return value

bool TRUE if the assertion succeeded, FALSE otherwise.

File

acquia_contenthub_subscriber/tests/src/Functional/ContentHubSubscriberTestBase.php, line 263

Class

ContentHubSubscriberTestBase
Provides the base class for web tests for Content Hub Subscribers.

Namespace

Drupal\Tests\acquia_contenthub_subscriber\Functional

Code

protected function assertResponseBody($expected, $message = '', $group = 'REST Response') {
  return $this
    ->assertSame($expected, $this->responseBody, $message ? $message : strtr('Response body @expected (expected) is equal to @response (actual).', [
    '@expected' => var_export($expected, TRUE),
    '@response' => var_export($this->responseBody, TRUE),
  ]), $group);
}