function EntityConverterLatestRevisionTest::testEntityNoPendingRevision
Tests with no pending revision.
File
- 
              core/
tests/ Drupal/ KernelTests/ Core/ ParamConverter/ EntityConverterLatestRevisionTest.php, line 71  
Class
- EntityConverterLatestRevisionTest
 - Tests the entity converter when the "load_latest_revision" flag is set.
 
Namespace
Drupal\KernelTests\Core\ParamConverterCode
public function testEntityNoPendingRevision() : void {
  $entity = EntityTestMulRev::create();
  $entity->save();
  $converted = $this->converter
    ->convert(1, [
    'load_latest_revision' => TRUE,
    'type' => 'entity:entity_test_mulrev',
  ], 'foo', []);
  $this->assertEquals($entity->getLoadedRevisionId(), $converted->getLoadedRevisionId());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.