Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / aggregator / tests / src / Functional / FeedCacheTagsTest.php
1 <?php
2
3 namespace Drupal\Tests\aggregator\Functional;
4
5 use Drupal\aggregator\Entity\Feed;
6 use Drupal\Tests\system\Functional\Entity\EntityWithUriCacheTagsTestBase;
7 use Drupal\user\Entity\Role;
8 use Drupal\user\RoleInterface;
9
10 /**
11  * Tests the Feed entity's cache tags.
12  *
13  * @group aggregator
14  */
15 class FeedCacheTagsTest extends EntityWithUriCacheTagsTestBase {
16
17   /**
18    * {@inheritdoc}
19    */
20   public static $modules = ['aggregator'];
21
22   /**
23    * {@inheritdoc}
24    */
25   protected function setUp() {
26     parent::setUp();
27
28     // Give anonymous users permission to access feeds, so that we can verify
29     // the cache tags of cached versions of feeds.
30     $user_role = Role::load(RoleInterface::ANONYMOUS_ID);
31     $user_role->grantPermission('access news feeds');
32     $user_role->save();
33   }
34
35   /**
36    * {@inheritdoc}
37    */
38   protected function createEntity() {
39     // Create a "Llama" feed.
40     $feed = Feed::create([
41       'title' => 'Llama',
42       'url' => 'https://www.drupal.org/',
43       'refresh' => 900,
44       'checked' => 1389919932,
45       'description' => 'Drupal.org',
46     ]);
47     $feed->save();
48
49     return $feed;
50   }
51
52 }