MigrateAggregatorItemTest.php in Zircon Profile 8.0
File
core/modules/aggregator/src/Tests/Migrate/d7/MigrateAggregatorItemTest.php
View source
<?php
namespace Drupal\aggregator\Tests\Migrate\d7;
use Drupal\aggregator\Entity\Item;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
class MigrateAggregatorItemTest extends MigrateDrupal7TestBase {
public static $modules = [
'aggregator',
];
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('aggregator_feed');
$this
->installEntitySchema('aggregator_item');
$this
->executeMigration('d7_aggregator_feed');
$this
->executeMigration('d7_aggregator_item');
}
public function testAggregatorItem() {
$items = $this->sourceDatabase
->select('aggregator_item', 'ai')
->fields('ai')
->execute();
foreach ($items as $original) {
$item = Item::load($original->iid);
$this
->assertIdentical($original->fid, $item
->getFeedId());
$this
->assertIdentical($original->title, $item
->label());
$this
->assertEqual($original->author, $item
->getAuthor());
$this
->assertIdentical($original->description, $item
->getDescription());
$this
->assertIdentical($original->link, $item
->getLink());
$this
->assertIdentical($original->timestamp, $item
->getPostedTime());
$this
->assertIdentical('en', $item
->language()
->getId());
$this
->assertIdentical($original->guid, $item
->getGuid());
}
}
}