You are here

public function AcsfMessageTest::testAcsfMessageResponseFailure in Acquia Cloud Site Factory Connector 8.2

Same name and namespace in other branches
  1. 8 tests/AcsfMessageTest.php \AcsfMessageTest::testAcsfMessageResponseFailure()

Tests that a response code greater than 0 triggers the correct exception.

File

tests/AcsfMessageTest.php, line 107
Provides PHPUnit tests for AcsfMessage.

Class

AcsfMessageTest
AcsfMessageTest.

Code

public function testAcsfMessageResponseFailure() {
  $config = new AcsfConfigUnitTest('unit_test_site', 'unit_test_env');
  $message = new AcsfMessageUnitTestFailure('TEST', 'unit_test_endpoint', [], $config);
  try {
    $caught = FALSE;
    $message
      ->send();
  } catch (AcsfMessageFailedResponseException $e) {
    $caught = TRUE;
  }
  $this
    ->assertTrue($caught);
  $this
    ->assertSame($message
    ->getResponseCode(), 1);
}