MigrateAggregatorFeedTest.php in Zircon Profile 8.0
File
core/modules/aggregator/src/Tests/Migrate/d7/MigrateAggregatorFeedTest.php
View source
<?php
namespace Drupal\aggregator\Tests\Migrate\d7;
use Drupal\aggregator\Entity\Feed;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
class MigrateAggregatorFeedTest extends MigrateDrupal7TestBase {
public static $modules = [
'aggregator',
];
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('aggregator_feed');
$this
->executeMigration('d7_aggregator_feed');
}
public function testAggregatorFeedImport() {
$feed = Feed::load(1);
$this
->assertIdentical('Know Your Meme', $feed
->label());
$this
->assertIdentical('en', $feed
->language()
->getId());
$this
->assertIdentical('http://knowyourmeme.com/newsfeed.rss', $feed
->getUrl());
$this
->assertIdentical('900', $feed
->getRefreshRate());
$checked_time = $feed
->getLastCheckedTime();
$this
->assertTrue(is_numeric($checked_time));
$this
->assertTrue($checked_time > 1000000000);
$this
->assertIdentical('0', $feed
->getQueuedTime());
$this
->assertIdentical('http://knowyourmeme.com', $feed->link->value);
$this
->assertIdentical('New items added to the News Feed', $feed
->getDescription());
$this
->assertNull($feed
->getImage());
$this
->assertTrue(preg_match('/^"[a-z0-9]{32}"$/', $feed
->getEtag()));
$this
->assertIdentical('0', $feed
->getLastModified());
}
}