function EntityRevisionTest::getEntityRevisionDestination

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\destination\EntityRevisionTest::getEntityRevisionDestination()
  2. 8.9.x core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\destination\EntityRevisionTest::getEntityRevisionDestination()
  3. 11.x core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\destination\EntityRevisionTest::getEntityRevisionDestination()

Helper method to create an entity revision destination with mock services.

Parameters

$configuration: Configuration for the destination.

string $plugin_id: The plugin id.

array $plugin_definition: The plugin definition.

Return value

\Drupal\Tests\migrate\Unit\destination\EntityRevision Mocked destination.

See also

\Drupal\Tests\migrate\Unit\Destination\EntityRevision

5 calls to EntityRevisionTest::getEntityRevisionDestination()
EntityRevisionTest::testGetEntityDestinationValues in core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php
Tests that passed old destination values are used by default.
EntityRevisionTest::testGetEntityLoadFailure in core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php
Tests entity load failure.
EntityRevisionTest::testGetEntityNewRevision in core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php
Tests that new revisions are flagged to be written as new.
EntityRevisionTest::testGetEntityUpdateRevision in core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php
Tests that revision updates update.
EntityRevisionTest::testSave in core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php
Tests entity revision save.

File

core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php, line 204

Class

EntityRevisionTest
Tests entity revision destination.

Namespace

Drupal\Tests\migrate\Unit\destination

Code

protected function getEntityRevisionDestination(array $configuration = [], $plugin_id = 'entity_revision', array $plugin_definition = []) {
    return new EntityRevision($configuration, $plugin_id, $plugin_definition, $this->migration
        ->reveal(), $this->storage
        ->reveal(), [], $this->entityFieldManager
        ->reveal(), $this->fieldTypeManager
        ->reveal(), $this->accountSwitcher
        ->reveal());
}

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