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