Skip to content
Snippets Groups Projects
Commit c329dfd4 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2321501 by Temoor, prics: Replace calls to aggregator_feed_load(),...

Issue #2321501 by Temoor, prics: Replace calls to aggregator_feed_load(), entity_load('aggregator_feed') and entity_load_multiple() with static method calls.
parent 365358c5
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -7,6 +7,9 @@
namespace Drupal\aggregator\Tests;
use Drupal\aggregator\Entity\Feed;
use Drupal\aggregator\Entity\Item;
/**
* Tests the processor plugins functionality and discoverability.
*
......@@ -33,7 +36,7 @@ public function testProcess() {
$feed = $this->createFeed();
$this->updateFeedItems($feed);
foreach ($feed->items as $iid) {
$item = entity_load('aggregator_item', $iid);
$item = Item::load($iid);
$this->assertTrue(strpos($item->label(), 'testProcessor') === 0);
}
}
......@@ -55,8 +58,11 @@ public function testDelete() {
public function testPostProcess() {
$feed = $this->createFeed(NULL, array('refresh' => 1800));
$this->updateFeedItems($feed);
$feed_id = $feed->id();
// Reset entity cache manually.
\Drupal::entityManager()->getStorage('aggregator_feed')->resetCache(array($feed_id));
// Reload the feed to get new values.
$feed = entity_load('aggregator_feed', $feed->id(), TRUE);
$feed = Feed::load($feed_id);
// Make sure its refresh rate doubled.
$this->assertEqual($feed->getRefreshRate(), 3600);
}
......
......@@ -39,7 +39,7 @@ protected function setUp() {
*/
public function testAggregatorFeedImport() {
/** @var Feed $feed */
$feed = entity_load('aggregator_feed', 5);
$feed = Feed::load(5);
$this->assertNotNull($feed->uuid());
$this->assertEqual($feed->title->value, 'Know Your Meme');
$this->assertEqual($feed->language()->id, 'en');
......
......@@ -59,7 +59,7 @@ protected function setUp() {
*/
public function testAggregatorItem() {
/** @var Item $item */
$item = entity_load('aggregator_item', 1);
$item = Item::load(1);
$this->assertEqual($item->id(), 1);
$this->assertEqual($item->getFeedId(), 5);
$this->assertEqual($item->label(), 'This (three) weeks in Drupal Core - January 10th 2014');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment