You are here

public function FeedDeleteTest::testFeedDelete in Feeds 8.3

Tests deleting a feed using the UI.

File

tests/src/Functional/FeedDeleteTest.php, line 15

Class

FeedDeleteTest
Tests deleting a feed using the UI.

Namespace

Drupal\Tests\feeds\Functional

Code

public function testFeedDelete() {

  // Add a feed type.
  $feed_type = $this
    ->createFeedType();

  // Add a feed.
  $feed = $this
    ->createFeed($feed_type
    ->id(), [
    'source' => $this
      ->resourcesPath() . '/rss/googlenewstz.rss2',
  ]);

  // Now try to delete this feed.
  $this
    ->drupalPostForm('/feed/1/delete', [], 'Delete');

  // Ensure that no errors are shown.
  $this
    ->assertSession()
    ->pageTextNotContains('The website encountered an unexpected error.');

  // Ensure that the feed no now longer exists.
  $this
    ->assertNull($this
    ->reloadEntity($feed));
}