function RemoveFeedTest::testRemoveFeed

Remove a feed and ensure that all it services are removed.

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedTest.php, line 22
Definition of Drupal\aggregator\Tests\RemoveFeedTest.

Class

RemoveFeedTest

Namespace

Drupal\aggregator\Tests

Code

function testRemoveFeed() {
  $feed = $this
    ->createFeed();

  // Delete feed.
  $this
    ->deleteFeed($feed);

  // Check feed source.
  $this
    ->drupalGet('aggregator/sources/' . $feed->fid);
  $this
    ->assertResponse(404, 'Deleted feed source does not exists.');

  // Check database for feed.
  $result = db_query("SELECT COUNT(*) FROM {aggregator_feed} WHERE title = :title AND url = :url", array(
    ':title' => $feed->title,
    ':url' => $feed->url,
  ))
    ->fetchField();
  $this
    ->assertFalse($result, 'Feed not found in database');
}