You are here

public function TestRestClient::objectCreate in Salesforce Suite 5.0.x

Same name and namespace in other branches
  1. 8.4 src/Tests/TestRestClient.php \Drupal\salesforce\Tests\TestRestClient::objectCreate()
  2. 8.3 src/Tests/TestRestClient.php \Drupal\salesforce\Tests\TestRestClient::objectCreate()

Create a new object of the given type.

Parameters

string $name: Object type name, E.g., Contact, Account, etc.

array $params: Values of the fields to set for the object.

Return value

\Drupal\salesforce\SFID The new object's SFID.

Overrides RestClient::objectCreate

File

src/Tests/TestRestClient.php, line 129

Class

TestRestClient
Test Salesforce REST client.

Namespace

Drupal\salesforce\Tests

Code

public function objectCreate($name, array $params) {
  $random = new Random();
  return new SFID(strtoupper($random
    ->string(SFID::MAX_LENGTH)));
}