/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->createTestField(); // Add the mapping. $mapping = rdf_get_mapping('entity_test', 'entity_test'); $mapping->setFieldMapping($this->fieldName, array('properties' => array('schema:link')))->save(); }
protected function setUp() { parent::setUp(); $this->createTestField(); // Add the mapping. $mapping = rdf_get_mapping('entity_test', 'entity_test'); $mapping->setFieldMapping($this->fieldName, array('properties' => array('schema:dateCreated')))->save(); // Set up test entity. $this->entity = EntityTest::create(array()); $this->entity->{$this->fieldName}->value = $this->testValue; }
protected function setUp() { parent::setUp(); $this->installConfig(array('filter')); $this->createTestField(); // Add the mapping. $mapping = rdf_get_mapping('entity_test', 'entity_test'); $mapping->setFieldMapping($this->fieldName, array('properties' => array('schema:text')))->save(); // Set up test entity. $this->entity = EntityTest::create(); $this->entity->{$this->fieldName}->value = $this->testValue; $this->entity->{$this->fieldName}->summary = $this->testSummary; }
protected function setUp() { parent::setUp(); $this->createTestField(); $this->installConfig(array('filter')); // Add the mapping. $mapping = rdf_get_mapping('entity_test', 'entity_test'); $mapping->setFieldMapping($this->fieldName, array('properties' => array('schema:interactionCount'), 'datatype_callback' => array('callable' => 'Drupal\\rdf\\Tests\\Field\\TestDataConverter::convertFoo')))->save(); // Set up test values. $this->testValue = $this->randomMachineName(); $this->entity = EntityTest::create(); $this->entity->{$this->fieldName}->value = $this->testValue; $this->entity->save(); $this->uri = $this->getAbsoluteUri($this->entity); }
protected function setUp() { parent::setUp(); $this->installEntitySchema('entity_test_rev'); // Give anonymous users permission to view test entities. $this->installConfig(array('user')); Role::load(RoleInterface::ANONYMOUS_ID)->grantPermission('view test entity')->save(); $this->createEntityReferenceField($this->entityType, $this->bundle, $this->fieldName, 'Field test', $this->entityType); // Add the mapping. $mapping = rdf_get_mapping('entity_test', 'entity_test'); $mapping->setFieldMapping($this->fieldName, array('properties' => array('schema:knows')))->save(); // Create the entity to be referenced. $this->targetEntity = $this->container->get('entity_type.manager')->getStorage($this->entityType)->create(array('name' => $this->randomMachineName())); $this->targetEntity->save(); // Create the entity that will have the entity reference field. $this->entity = $this->container->get('entity_type.manager')->getStorage($this->entityType)->create(array('name' => $this->randomMachineName())); $this->entity->save(); $this->entity->{$this->fieldName}->entity = $this->targetEntity; $this->uri = $this->getAbsoluteUri($this->entity); }