X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Faggregator%2Ftests%2Fsrc%2FFunctional%2FFeedParserTest.php;h=e340b27a9819cd5a01305c9761c0681fffce936e;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=ecb2e50c76e587759d62324ed912974f8b733550;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/aggregator/tests/src/Functional/FeedParserTest.php b/web/core/modules/aggregator/tests/src/Functional/FeedParserTest.php index ecb2e50c7..e340b27a9 100644 --- a/web/core/modules/aggregator/tests/src/Functional/FeedParserTest.php +++ b/web/core/modules/aggregator/tests/src/Functional/FeedParserTest.php @@ -4,6 +4,7 @@ namespace Drupal\Tests\aggregator\Functional; use Drupal\Core\Url; use Drupal\aggregator\Entity\Feed; +use Drupal\aggregator\Entity\Item; /** * Tests the built-in feed parser with valid feed samples. @@ -57,16 +58,17 @@ class FeedParserTest extends AggregatorTestBase { $this->assertText('Atom-Powered Robots Run Amok'); $this->assertLinkByHref('http://example.org/2003/12/13/atom03'); $this->assertText('Some text.'); - $this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', db_query('SELECT guid FROM {aggregator_item} WHERE link = :link', [':link' => 'http://example.org/2003/12/13/atom03'])->fetchField(), 'Atom entry id element is parsed correctly.'); + $iids = \Drupal::entityQuery('aggregator_item')->condition('link', 'http://example.org/2003/12/13/atom03')->execute(); + $item = Item::load(array_values($iids)[0]); + $this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', $item->getGuid(), 'Atom entry id element is parsed correctly.'); // Check for second feed entry. $this->assertText('We tried to stop them, but we failed.'); $this->assertLinkByHref('http://example.org/2003/12/14/atom03'); $this->assertText('Some other text.'); - $db_guid = db_query('SELECT guid FROM {aggregator_item} WHERE link = :link', [ - ':link' => 'http://example.org/2003/12/14/atom03', - ])->fetchField(); - $this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-bbbb-80da344efa6a', $db_guid, 'Atom entry id element is parsed correctly.'); + $iids = \Drupal::entityQuery('aggregator_item')->condition('link', 'http://example.org/2003/12/14/atom03')->execute(); + $item = Item::load(array_values($iids)[0]); + $this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-bbbb-80da344efa6a', $item->getGuid(), 'Atom entry id element is parsed correctly.'); } /**