Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / aggregator / tests / src / Functional / FeedFetcherPluginTest.php
1 <?php
2
3 namespace Drupal\Tests\aggregator\Functional;
4
5 /**
6  * Tests the fetcher plugins functionality and discoverability.
7  *
8  * @group aggregator
9  *
10  * @see \Drupal\aggregator_test\Plugin\aggregator\fetcher\TestFetcher.
11  */
12 class FeedFetcherPluginTest extends AggregatorTestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   protected function setUp() {
18     parent::setUp();
19     // Enable test plugins.
20     $this->enableTestPlugins();
21     // Create some nodes.
22     $this->createSampleNodes();
23   }
24
25   /**
26    * Test fetching functionality.
27    */
28   public function testfetch() {
29     // Create feed with local url.
30     $feed = $this->createFeed();
31     $this->updateFeedItems($feed);
32     $this->assertFalse(empty($feed->items));
33
34     // Delete items and restore checked property to 0.
35     $this->deleteFeedItems($feed);
36     // Change its name and try again.
37     $feed->setTitle('Do not fetch');
38     $feed->save();
39     $this->updateFeedItems($feed);
40     // Fetch should fail due to feed name.
41     $this->assertTrue(empty($feed->items));
42   }
43
44 }