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