You are here

function XmlrpcExampleTestCase::testXmlrpcExampleClient in Examples for Developers 6

Same name and namespace in other branches
  1. 7 xmlrpc_example/xmlrpc_example.test \XmlrpcExampleTestCase::testXmlrpcExampleClient()

Perform several calls using xmlrpc UI client

File

xmlrpc_example/xmlrpc_example.test, line 56
Test case for the xmlrpc example module.

Class

XmlrpcExampleTestCase
@file Test case for the xmlrpc example module.

Code

function testXmlrpcExampleClient() {

  // Now test the UI.
  $edit = array(
    'num1' => 3,
    'num2' => 5,
  );
  $this
    ->drupalPost('examples/xmlrpc_client', $edit, t('Add the integers'));
  $this
    ->assertText(t("The XMLRPC server returned this response: @num", array(
    '@num' => 8,
  )));
  $edit = array(
    'num1' => 8,
    'num2' => 3,
  );
  $this
    ->drupalPost('examples/xmlrpc_client', $edit, t('Subtract the integers'));
  $this
    ->assertText(t("The XMLRPC server returned this response: @num", array(
    '@num' => 5,
  )));
}