You are here

public function XmlRpcBasicTest::testInvalidServer in xmlrpc 8

Addresses bug https://www.drupal.org/node/2146833 .

@link http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php

File

src/Tests/XmlRpcBasicTest.php, line 120

Class

XmlRpcBasicTest
Perform basic XML-RPC tests that do not require addition callbacks.

Namespace

Drupal\xmlrpc\Tests

Code

public function testInvalidServer() {
  $invalid_endpoint = 'http://example.invalid/xmlrpc';
  $result = xmlrpc($invalid_endpoint, [
    'system.listMethods' => [],
  ]);
  $this
    ->verboseResult($result);
  $this
    ->assertFalse($result, "Calling an unknown host returns an error condition");
  $this
    ->assertEqual(-32300, xmlrpc_errno(), "Calling an unknown host is reported as a transport error.");
  $message = xmlrpc_error_msg();
  $this
    ->assertFalse(empty($message), "Calling an unknown host returns a meaningful error message.");
}