protected function setUp() { parent::setUp(); // Create the test field storage. entity_create('field_storage_config', array('entity_type' => 'entity_test_mulrev', 'field_name' => 'field_test_entity_reference', 'type' => 'entity_reference', 'settings' => array('target_type' => 'entity_test_mulrev')))->save(); // Create the test field. entity_create('field_config', array('entity_type' => 'entity_test_mulrev', 'field_name' => 'field_test_entity_reference', 'bundle' => 'entity_test_mulrev'))->save(); }
protected function setUp() { parent::setUp(); \Drupal::service('router.builder')->rebuild(); // Create the test field storage. FieldStorageConfig::create(array('entity_type' => 'entity_test_mulrev', 'field_name' => 'field_test_entity_reference', 'type' => 'entity_reference', 'settings' => array('target_type' => 'entity_test_mulrev')))->save(); // Create the test field. FieldConfig::create(['entity_type' => 'entity_test_mulrev', 'field_name' => 'field_test_entity_reference', 'bundle' => 'entity_test_mulrev'])->save(); }
/** * {@inheritdoc} */ function setUp() { parent::setUp(); \Drupal::service('router.builder')->rebuild(); $this->installSchema('system', array('sequences')); $this->installSchema('comment', array('comment_entity_statistics')); $this->installEntitySchema('node'); $this->installEntitySchema('comment'); $this->installEntitySchema('taxonomy_term'); }
protected function setUp() { parent::setUp(); // User create needs sequence table. $this->installSchema('system', array('sequences')); // Create a test user to use as the entity owner. $this->user = \Drupal::entityManager()->getStorage('user')->create(['name' => 'serialization_test_user', 'mail' => '*****@*****.**', 'pass' => '123456']); $this->user->save(); // Create a test entity to serialize. $this->values = array('name' => $this->randomMachineName(), 'user_id' => $this->user->id(), 'field_test_text' => array('value' => $this->randomMachineName(), 'format' => 'full_html')); $this->entity = EntityTestMulRev::create($this->values); $this->entity->save(); $this->serializer = $this->container->get('serializer'); $this->installConfig(array('field')); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); \Drupal::service('router.builder')->rebuild(); }