3 namespace Drupal\Tests\aggregator\Functional;
6 * Delete feed items from a feed.
10 class DeleteFeedItemTest extends AggregatorTestBase {
12 * Tests running "delete items" from 'admin/config/services/aggregator' page.
14 public function testDeleteFeedItem() {
15 // Create a bunch of test feeds.
17 // No last-modified, no etag.
18 $feed_urls[] = \Drupal::url('aggregator_test.feed', [], ['absolute' => TRUE]);
19 // Last-modified, but no etag.
20 $feed_urls[] = \Drupal::url('aggregator_test.feed', ['use_last_modified' => 1], ['absolute' => TRUE]);
21 // No Last-modified, but etag.
22 $feed_urls[] = \Drupal::url('aggregator_test.feed', ['use_last_modified' => 0, 'use_etag' => 1], ['absolute' => TRUE]);
23 // Last-modified and etag.
24 $feed_urls[] = \Drupal::url('aggregator_test.feed', ['use_last_modified' => 1, 'use_etag' => 1], ['absolute' => TRUE]);
26 foreach ($feed_urls as $feed_url) {
27 $feed = $this->createFeed($feed_url);
28 // Update and delete items two times in a row to make sure that removal
29 // resets all 'modified' information (modified, etag, hash) and allows for
30 // immediate update. There's 8 items in the feed, but one has an empty
31 // title and is skipped.
32 $this->updateAndDelete($feed, 7);
33 $this->updateAndDelete($feed, 7);
34 $this->updateAndDelete($feed, 7);
36 $this->deleteFeed($feed);