You are here

public function CivicrmStorageGetTest::testGet in CiviCRM Entity 8.3

Tests getting a single entity.

File

tests/src/Kernel/CivicrmStorageGetTest.php, line 20

Class

CivicrmStorageGetTest
Tests the storage.

Namespace

Drupal\Tests\civicrm_entity\Kernel

Code

public function testGet() {
  $result = $this->container
    ->get('civicrm_entity.api')
    ->get('event', [
    'id' => 1,
    'return' => array_keys($this
      ->sampleEventsGetFields()),
  ]);
  $this
    ->assertEquals('Fall Fundraiser Dinner', $result[0]['title']);
  $result = $this->container
    ->get('civicrm_entity.api')
    ->get('contact', [
    'id' => 10,
    'return' => array_keys($this
      ->sampleContactGetFields()),
  ]);
  $this
    ->assertEquals('Emma Neal', $result[0]['display_name']);
}