createDestination example

$this->container->get('entity_field.manager'),
      $this->container->get('plugin.manager.field.field_type'),
      $this->container->get('account_switcher')
    );
  }

  /** * Tests importing and rolling back translated entities. */
  public function testTranslated() {
    // Create a destination.     $this->createDestination(['translations' => TRUE]);

    // Create some pre-existing entities.     $this->storage->create(['id' => 1, 'langcode' => 'en'])->save();
    $this->storage->create(['id' => 2, 'langcode' => 'fr'])->save();
    $translated = $this->storage->create(['id' => 3, 'langcode' => 'en']);
    $translated->save();
    $translated->addTranslation('fr')->save();

    // Pre-assert that things are as expected.     $this->assertTranslations(1, 'en');
    $this->assertTranslations(2, 'fr');
    
Home | Imprint | This part of the site doesn't use cookies.