function EntityConverterLatestRevisionTest::testConvertNonRevisionableEntityType

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php \Drupal\KernelTests\Core\ParamConverter\EntityConverterLatestRevisionTest::testConvertNonRevisionableEntityType()
  2. 10 core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php \Drupal\KernelTests\Core\ParamConverter\EntityConverterLatestRevisionTest::testConvertNonRevisionableEntityType()
  3. 11.x core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php \Drupal\KernelTests\Core\ParamConverter\EntityConverterLatestRevisionTest::testConvertNonRevisionableEntityType()

Test the latest revision flag and non-revisionable entities.

File

core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php, line 180

Class

EntityConverterLatestRevisionTest
Tests the entity converter when the "load_latest_revision" flag is set.

Namespace

Drupal\KernelTests\Core\ParamConverter

Code

public function testConvertNonRevisionableEntityType() {
    $entity = EntityTest::create();
    $entity->save();
    $converted = $this->converter
        ->convert(1, [
        'load_latest_revision' => TRUE,
        'type' => 'entity:entity_test',
    ], 'foo', []);
    $this->assertEquals($entity->id(), $converted->id());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.