CommentEntityDisplayTest.php in Commerce Migrate 3.0.x        
                          
                  
                        
  
  
  
  
File
  modules/ubercart/tests/src/Kernel/Migrate/uc7/CommentEntityDisplayTest.php
  
    View source  
  <?php
namespace Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
class CommentEntityDisplayTest extends Ubercart7TestBase {
  
  public static $modules = [
    'comment',
    'commerce_price',
    'commerce_product',
    'commerce_store',
    'node',
    'path',
    'text',
  ];
  
  protected function setUp() {
    parent::setUp();
    $this
      ->migrateContentTypes();
    $this
      ->migrateCommentFields();
    $this
      ->executeMigration('uc7_comment_entity_display');
  }
  
  protected function assertDisplay($id, $component_id) {
    $component = EntityViewDisplay::load($id)
      ->getComponent($component_id);
    $this
      ->assertIsArray($component);
    $this
      ->assertSame('hidden', $component['label']);
    $this
      ->assertSame('comment_default', $component['type']);
    $this
      ->assertSame(20, $component['weight']);
  }
  
  public function testMigration() {
    $this
      ->assertDisplay('commerce_product.product.default', 'comment_node_product');
    $this
      ->assertDisplay('commerce_product.entertainment.default', 'comment_node_entertainment');
  }
}