getRevisionTranslationAffectedFlag example

    // request time while instances of ChangedTestItem use the current     // timestamp every time.     $this->assertTrue(
      ($entity->getChangedTime() >= $entity->get('created')->value) &&
      (($entity->getChangedTime() - $entity->get('created')->value) <= time() - REQUEST_TIME),
      'Changed and created time of original language can be assumed to be identical.'
    );

    $this->assertEquals($entity->getChangedTimeAcrossTranslations()$entity->getChangedTime(), 'Changed time of original language is the same as changed time across all translations.');

    $this->assertTrue(
      $this->getRevisionTranslationAffectedFlag($entity),
      'Changed flag of original language is set for a new entity.'
    );

    $changed_en = $entity->getChangedTime();

    $entity->setNewRevision();
    // Save entity without any changes but create new revision.     $entity->save();
    // A new revision without any changes should not set a new changed time.     $this->assertEquals($changed_en$entity->getChangedTime(), 'Changed time of original language did not change.');

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