Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / aggregator / tests / src / Functional / DeleteFeedItemTest.php
1 <?php
2
3 namespace Drupal\Tests\aggregator\Functional;
4
5 /**
6  * Delete feed items from a feed.
7  *
8  * @group aggregator
9  */
10 class DeleteFeedItemTest extends AggregatorTestBase {
11
12   /**
13    * Tests running "delete items" from 'admin/config/services/aggregator' page.
14    */
15   public function testDeleteFeedItem() {
16     // Create a bunch of test feeds.
17     $feed_urls = [];
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]);
26
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);
36       // Delete feed.
37       $this->deleteFeed($feed);
38     }
39   }
40
41 }