doTestInternalProperties example

$revision->getTranslation('it')->get('name')->value = 'Test 1.3 IT';
    $violations = $revision->validate();
    $this->assertCount(1, $violations);
    $this->assertEquals('Non-translatable fields can only be changed when updating the original language.', $violations[0]->getMessage());
  }

  /** * Tests that internal properties are preserved while creating a new revision. */
  public function testInternalProperties() {
    $entity = EntityTestMulRev::create();
    $this->doTestInternalProperties($entity);

    $entity = EntityTestMulRev::create();
    $entity->save();
    $this->doTestInternalProperties($entity);

    /** @var \Drupal\entity_test\Entity\EntityTestMulRev $translation */
    $translation = EntityTestMulRev::create()->addTranslation('it');
    $translation->save();
    $this->doTestInternalProperties($translation);
  }

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