8.2.x AggregatorTestBase.php public AggregatorTestBase::updateAndDelete(FeedInterface $feed, $expected_count)
8.0.x AggregatorTestBase.php public AggregatorTestBase::updateAndDelete(FeedInterface $feed, $expected_count)
8.1.x AggregatorTestBase.php public AggregatorTestBase::updateAndDelete(FeedInterface $feed, $expected_count)
8.3.x AggregatorTestBase.php public AggregatorTestBase::updateAndDelete(FeedInterface $feed, $expected_count)
8.3.x AggregatorTestBase.php public AggregatorTestBase::updateAndDelete(FeedInterface $feed, $expected_count)

Adds and deletes feed items and ensure that the count is zero.

Parameters

\Drupal\aggregator\FeedInterface $feed: Feed object representing the feed.

int $expected_count: Expected number of feed items.

2 calls to AggregatorTestBase::updateAndDelete()
DeleteFeedItemTest::testDeleteFeedItem in core/modules/aggregator/src/Tests/DeleteFeedItemTest.php
Tests running "delete items" from 'admin/config/services/aggregator' page.
FeedProcessorPluginTest::testDelete in core/modules/aggregator/src/Tests/FeedProcessorPluginTest.php
Test deleting functionality.

File

core/modules/aggregator/src/Tests/AggregatorTestBase.php, line 206

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\aggregator\Tests

Code

public function updateAndDelete(FeedInterface $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->deleteFeedItems($feed);
  $count = db_query('SELECT COUNT(*) FROM {aggregator_item} WHERE fid = :fid', array(':fid' => $feed->id()))->fetchField();
  $this->assertTrue($count == 0);
}