function MigrateAggregatorFeedTest::testAggregatorFeedImport
Same name in this branch
- 9 core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorFeedTest.php \Drupal\Tests\aggregator\Kernel\Migrate\d6\MigrateAggregatorFeedTest::testAggregatorFeedImport()
Same name in other branches
- 8.9.x core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorFeedTest.php \Drupal\Tests\aggregator\Kernel\Migrate\d6\MigrateAggregatorFeedTest::testAggregatorFeedImport()
- 8.9.x core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorFeedTest.php \Drupal\Tests\aggregator\Kernel\Migrate\d7\MigrateAggregatorFeedTest::testAggregatorFeedImport()
Tests migration of aggregator feeds.
File
-
core/
modules/ aggregator/ tests/ src/ Kernel/ Migrate/ d7/ MigrateAggregatorFeedTest.php, line 27
Class
- MigrateAggregatorFeedTest
- Test migration to aggregator_feed entities.
Namespace
Drupal\Tests\aggregator\Kernel\Migrate\d7Code
public function testAggregatorFeedImport() {
/** @var \Drupal\aggregator\FeedInterface $feed */
$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());
// The feed's last checked time can change as the fixture is updated, so
// assert that its format is correct.
$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());
// As with getLastCheckedTime(), the etag can change as the fixture is
// updated normally, so assert that its format is correct.
$this->assertMatchesRegularExpression('/^"[a-z0-9]{32}"$/', $feed->getEtag());
$this->assertSame('0', $feed->getLastModified());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.