You are here

protected function DeveloperAppFieldTest::typesTest in Apigee Edge 8

Tests developer app entity preSave().

1 call to DeveloperAppFieldTest::typesTest()
DeveloperAppFieldTest::testFieldableDeveloperApp in tests/src/Functional/DeveloperAppFieldTest.php
Tests fieldable developer app entity.

File

tests/src/Functional/DeveloperAppFieldTest.php, line 298

Class

DeveloperAppFieldTest
Fieldable developer app test.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

protected function typesTest() {
  $field_values = [
    'scopes' => [
      'a',
      'b',
      'c',
    ],
    'displayName' => $this
      ->getRandomGenerator()
      ->word(16),
  ];
  foreach ($field_values as $field_name => $field_value) {
    $this->developerApp
      ->set($field_name, $field_value);
  }
  $this->developerApp
    ->preSave(new class implements EntityStorageInterface {

    /**
     * {@inheritdoc}
     */
    public function resetCache(array $ids = NULL) {
    }

    /**
     * {@inheritdoc}
     */
    public function loadMultiple(array $ids = NULL) {
    }

    /**
     * {@inheritdoc}
     */
    public function load($id) {
    }

    /**
     * {@inheritdoc}
     */
    public function loadUnchanged($id) {
    }

    /**
     * {@inheritdoc}
     */
    public function loadRevision($revision_id) {
    }

    /**
     * {@inheritdoc}
     */
    public function deleteRevision($revision_id) {
    }

    /**
     * {@inheritdoc}
     */
    public function loadByProperties(array $values = []) {
    }

    /**
     * {@inheritdoc}
     */
    public function create(array $values = []) {
    }

    /**
     * {@inheritdoc}
     */
    public function delete(array $entities) {
    }

    /**
     * {@inheritdoc}
     */
    public function save(EntityInterface $entity) {
    }

    /**
     * {@inheritdoc}
     */
    public function hasData() {
    }

    /**
     * {@inheritdoc}
     */
    public function getQuery($conjunction = 'AND') {
    }

    /**
     * {@inheritdoc}
     */
    public function getAggregateQuery($conjunction = 'AND') {
    }

    /**
     * {@inheritdoc}
     */
    public function getEntityTypeId() {
    }

    /**
     * {@inheritdoc}
     */
    public function getEntityType() {
    }

    /**
     * {@inheritdoc}
     */
    public function restore(EntityInterface $entity) {
    }

  });
  foreach ($field_values as $field_name => $field_value) {
    $getter = 'get' . ucfirst($field_name);
    $value = call_user_func([
      $this->developerApp,
      $getter,
    ]);
    if ($value instanceof \DateTimeImmutable) {
      $value = $value
        ->getTimestamp();
    }
    $this
      ->assertEquals($field_value, $value);
  }
}