function EntityRevisionTest::testUnrevisionable
Same name in other branches
- 8.9.x core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\Plugin\migrate\destination\EntityRevisionTest::testUnrevisionable()
- 10 core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\Plugin\migrate\destination\EntityRevisionTest::testUnrevisionable()
- 11.x core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php \Drupal\Tests\migrate\Unit\Plugin\migrate\destination\EntityRevisionTest::testUnrevisionable()
Tests that revision destination fails for unrevisionable entities.
File
-
core/
modules/ migrate/ tests/ src/ Unit/ Plugin/ migrate/ destination/ EntityRevisionTest.php, line 41
Class
- EntityRevisionTest
- Tests entity revision destination functionality.
Namespace
Drupal\Tests\migrate\Unit\Plugin\migrate\destinationCode
public function testUnrevisionable() {
$this->entityType
->getKey('id')
->willReturn('id');
$this->entityType
->getKey('revision')
->willReturn('');
$this->entityFieldManager
->getBaseFieldDefinitions('foo')
->willReturn([
'id' => BaseFieldDefinitionTest::create('integer'),
]);
$destination = new EntityRevisionTestDestination([], '', [], $this->migration
->reveal(), $this->storage
->reveal(), [], $this->entityFieldManager
->reveal(), $this->prophesize(FieldTypePluginManagerInterface::class)
->reveal(), $this->prophesize(AccountSwitcherInterface::class)
->reveal());
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('The "foo" entity type does not support revisions.');
$destination->getIds();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.