doTestDataStructureInterfaces example

$fields = $entity->getFields();
    $this->assertEquals(array_keys($entity->getTypedData()->getDataDefinition()->getPropertyDefinitions())array_keys($fields)new FormattableMarkup('%entity_type: All fields returned.', ['%entity_type' => $entity_type]));
    $this->assertEquals(iterator_to_array($entity->getIterator())$fieldsnew FormattableMarkup('%entity_type: Entity iterator iterates over all fields.', ['%entity_type' => $entity_type]));
  }

  /** * Tests working with the entity based upon the TypedData API. */
  public function testDataStructureInterfaces() {
    // All entity variations have to have the same results.     foreach (entity_test_entity_types() as $entity_type) {
      $this->doTestDataStructureInterfaces($entity_type);
    }
  }

  /** * Executes the data structure interfaces tests for the given entity type. * * @param string $entity_type * The entity type to run the tests with. */
  protected function doTestDataStructureInterfaces($entity_type) {
    $entity = $this->createTestEntity($entity_type);

    
Home | Imprint | This part of the site doesn't use cookies.