Pull merge.
[yaffs-website] / web / core / modules / aggregator / tests / src / Kernel / Migrate / d6 / MigrateAggregatorItemTest.php
1 <?php
2
3 namespace Drupal\Tests\aggregator\Kernel\Migrate\d6;
4
5 use Drupal\aggregator\Entity\Item;
6 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
7
8 /**
9  * Tests migration of aggregator items.
10  *
11  * @group migrate_drupal_6
12  */
13 class MigrateAggregatorItemTest extends MigrateDrupal6TestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public static $modules = ['aggregator'];
19
20   /**
21    * {@inheritdoc}
22    */
23   protected function setUp() {
24     parent::setUp();
25     $this->installEntitySchema('aggregator_feed');
26     $this->installEntitySchema('aggregator_item');
27     $this->executeMigrations(['d6_aggregator_feed', 'd6_aggregator_item']);
28   }
29
30   /**
31    * Test Drupal 6 aggregator item migration to Drupal 8.
32    */
33   public function testAggregatorItem() {
34     /** @var \Drupal\aggregator\Entity\Item $item */
35     $item = Item::load(1);
36     $this->assertIdentical('1', $item->id());
37     $this->assertIdentical('5', $item->getFeedId());
38     $this->assertIdentical('This (three) weeks in Drupal Core - January 10th 2014', $item->label());
39     $this->assertIdentical('larowlan', $item->getAuthor());
40     $this->assertIdentical("<h2 id='new'>What's new with Drupal 8?</h2>", $item->getDescription());
41     $this->assertIdentical('https://groups.drupal.org/node/395218', $item->getLink());
42     $this->assertIdentical('1389297196', $item->getPostedTime());
43     $this->assertIdentical('en', $item->language()->getId());
44     $this->assertIdentical('395218 at https://groups.drupal.org', $item->getGuid());
45
46   }
47
48 }