X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FKernel%2FMigrate%2Fd7%2FMigrateCommentTypeTest.php;h=b0c96dab837ce78a3a18efb7cba016a816d6a255;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=60f640d297d962b90b2c660a2e6b4497a77e2927;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php b/web/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php index 60f640d29..b0c96dab8 100644 --- a/web/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php +++ b/web/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php @@ -2,29 +2,29 @@ namespace Drupal\Tests\comment\Kernel\Migrate\d7; -use Drupal\comment\CommentTypeInterface; use Drupal\comment\Entity\CommentType; use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase; /** - * Tests migration of comment types from Drupal 7. + * Tests the migration of comment types from Drupal 7. * * @group comment + * @group migrate_drupal_7 */ class MigrateCommentTypeTest extends MigrateDrupal7TestBase { - public static $modules = ['node', 'comment', 'text', 'menu_ui']; + /** + * {@inheritdoc} + */ + public static $modules = ['node', 'comment', 'text']; /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); - $this->installConfig(static::$modules); - $this->executeMigrations([ - 'd7_node_type', - 'd7_comment_type', - ]); + $this->installConfig(['comment']); + $this->executeMigration('d7_comment_type'); } /** @@ -37,26 +37,21 @@ class MigrateCommentTypeTest extends MigrateDrupal7TestBase { */ protected function assertEntity($id, $label) { $entity = CommentType::load($id); - $this->assertTrue($entity instanceof CommentTypeInterface); - /** @var \Drupal\comment\CommentTypeInterface $entity */ - $this->assertIdentical($label, $entity->label()); - $this->assertIdentical('node', $entity->getTargetEntityTypeId()); + $this->assertInstanceOf(CommentType::class, $entity); + $this->assertSame($label, $entity->label()); + $this->assertSame('node', $entity->getTargetEntityTypeId()); } /** * Tests the migrated comment types. */ public function testMigration() { - $this->assertEntity('comment_node_page', 'Basic page comment'); $this->assertEntity('comment_node_article', 'Article comment'); $this->assertEntity('comment_node_blog', 'Blog entry comment'); $this->assertEntity('comment_node_book', 'Book page comment'); - $this->assertEntity('comment_node_forum', 'Forum topic comment'); + $this->assertEntity('comment_forum', 'Forum topic comment'); + $this->assertEntity('comment_node_page', 'Basic page comment'); $this->assertEntity('comment_node_test_content_type', 'Test content type comment'); - - $migration = $this->getMigration('d7_comment_type'); - // Validate that the source count and processed count match up. - $this->assertIdentical($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount()); } }