5 * Contains \Drupal\Tests\migrate\Unit\Plugin\migrate\destination\EntityTestBase
8 namespace Drupal\Tests\migrate\Unit\Plugin\migrate\destination;
10 use Drupal\Core\Entity\EntityManagerInterface;
11 use Drupal\Core\Entity\EntityStorageInterface;
12 use Drupal\Core\Entity\EntityTypeInterface;
13 use Drupal\Core\Field\BaseFieldDefinition;
14 use Drupal\migrate\Plugin\MigrationInterface;
15 use Drupal\Tests\UnitTestCase;
18 * Base test class forentity migration destination functionality.
20 class EntityTestBase extends UnitTestCase {
23 * @var \Drupal\migrate\Plugin\MigrationInterface
28 * @var \Drupal\Core\Entity\EntityStorageInterface
33 * @var \Drupal\Core\Entity\EntityTypeInterface
35 protected $entityType;
38 * @var \Drupal\Core\Entity\EntityManagerInterface
40 protected $entityManager;
45 protected function setUp() {
48 $this->migration = $this->prophesize(MigrationInterface::class);
49 $this->storage = $this->prophesize(EntityStorageInterface::class);
51 $this->entityType = $this->prophesize(EntityTypeInterface::class);
52 $this->entityType->getPluralLabel()->willReturn('wonkiness');
53 $this->storage->getEntityType()->willReturn($this->entityType->reveal());
54 $this->storage->getEntityTypeId()->willReturn('foo');
56 $this->entityManager = $this->prophesize(EntityManagerInterface::class);
62 * Stub class for BaseFieldDefinition.
64 class BaseFieldDefinitionTest extends BaseFieldDefinition {
66 public static function create($type) {
67 return new static([]);
70 public function getSettings() {
74 public function getType() {