Adds and removes feed items and ensure that the count is zero.
\Drupal\aggregator\Plugin\Core\Entity\Feed $feed: Feed object representing the feed.
int $expected_count: Expected number of feed items.
function updateAndRemove(Feed $feed, $expected_count) {
$this
->updateFeedItems($feed, $expected_count);
$count = db_query('SELECT COUNT(*) FROM {aggregator_item} WHERE fid = :fid', array(
':fid' => $feed
->id(),
))
->fetchField();
$this
->assertTrue($count);
$this
->removeFeedItems($feed);
$count = db_query('SELECT COUNT(*) FROM {aggregator_item} WHERE fid = :fid', array(
':fid' => $feed
->id(),
))
->fetchField();
$this
->assertTrue($count == 0);
}