Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / migrate_drupal / tests / src / Kernel / Plugin / migrate / source / ContentEntityTest.php
index 72372afc2e869a73fda4bcbe2a3e90a3c25b947b..33e0197e2f5412facc613852b1349132c0475baf 100644 (file)
@@ -5,7 +5,6 @@ namespace Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source;
 use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Language\LanguageInterface;
-use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait;
 use Drupal\file\Entity\File;
 use Drupal\KernelTests\KernelTestBase;
 use Drupal\language\Entity\ConfigurableLanguage;
@@ -16,7 +15,8 @@ use Drupal\node\Entity\Node;
 use Drupal\node\Entity\NodeType;
 use Drupal\taxonomy\Entity\Term;
 use Drupal\taxonomy\Entity\Vocabulary;
-use Drupal\Tests\media\Functional\MediaFunctionalTestCreateMediaTypeTrait;
+use Drupal\Tests\field\Traits\EntityReferenceTestTrait;
+use Drupal\Tests\media\Traits\MediaTypeCreationTrait;
 use Drupal\user\Entity\User;
 
 /**
@@ -27,7 +27,7 @@ use Drupal\user\Entity\User;
 class ContentEntityTest extends KernelTestBase {
 
   use EntityReferenceTestTrait;
-  use MediaFunctionalTestCreateMediaTypeTrait;
+  use MediaTypeCreationTrait;
 
   /**
    * {@inheritdoc}
@@ -244,7 +244,7 @@ class ContentEntityTest extends KernelTestBase {
     ];
     $migration = $this->migrationPluginManager->createStubMigration($this->migrationDefinition('content_entity:user'));
     $user_source = $this->sourcePluginManager->createInstance('content_entity:user', $configuration, $migration);
-    $this->assertSame('user entities', $user_source->__toString());
+    $this->assertSame('users', $user_source->__toString());
     $this->assertEquals(1, $user_source->count());
     $ids = $user_source->getIds();
     $this->assertArrayHasKey('langcode', $ids);
@@ -279,7 +279,7 @@ class ContentEntityTest extends KernelTestBase {
     ];
     $migration = $this->migrationPluginManager->createStubMigration($this->migrationDefinition('content_entity:file'));
     $file_source = $this->sourcePluginManager->createInstance('content_entity:file', $configuration, $migration);
-    $this->assertSame('file entities', $file_source->__toString());
+    $this->assertSame('files', $file_source->__toString());
     $this->assertEquals(1, $file_source->count());
     $ids = $file_source->getIds();
     $this->assertArrayHasKey('fid', $ids);
@@ -339,12 +339,11 @@ class ContentEntityTest extends KernelTestBase {
   public function testMediaSource() {
     $values = [
       'id' => 'image',
-      'bundle' => 'image',
       'label' => 'Image',
       'source' => 'test',
       'new_revision' => FALSE,
     ];
-    $media_type = $this->createMediaType($values);
+    $media_type = $this->createMediaType('test', $values);
     $media = Media::create([
       'name' => 'Foo media',
       'uid' => $this->user->id(),
@@ -395,7 +394,7 @@ class ContentEntityTest extends KernelTestBase {
     ];
     $migration = $this->migrationPluginManager->createStubMigration($this->migrationDefinition('content_entity:taxonomy_term'));
     $term_source = $this->sourcePluginManager->createInstance('content_entity:taxonomy_term', $configuration, $migration);
-    $this->assertSame('taxonomy term entities', $term_source->__toString());
+    $this->assertSame('taxonomy terms', $term_source->__toString());
     $this->assertEquals(2, $term_source->count());
     $ids = $term_source->getIds();
     $this->assertArrayHasKey('langcode', $ids);