public function AggregatorTestBase::updateAndDelete in Drupal 8
Same name in this branch
- 8 core/modules/aggregator/src/Tests/AggregatorTestBase.php \Drupal\aggregator\Tests\AggregatorTestBase::updateAndDelete()
- 8 core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php \Drupal\Tests\aggregator\Functional\AggregatorTestBase::updateAndDelete()
Same name and namespace in other branches
- 9 core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php \Drupal\Tests\aggregator\Functional\AggregatorTestBase::updateAndDelete()
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/ tests/ src/ Functional/ DeleteFeedItemTest.php - Tests running "delete items" from 'admin/config/services/aggregator' page.
- FeedProcessorPluginTest::testDelete in core/
modules/ aggregator/ tests/ src/ Functional/ FeedProcessorPluginTest.php - Test deleting functionality.
File
- core/
modules/ aggregator/ tests/ src/ Functional/ AggregatorTestBase.php, line 228
Class
- AggregatorTestBase
- Defines a base class for testing the Aggregator module.
Namespace
Drupal\Tests\aggregator\FunctionalCode
public function updateAndDelete(FeedInterface $feed, $expected_count) {
$count_query = \Drupal::entityQuery('aggregator_item')
->condition('fid', $feed
->id())
->count();
$this
->updateFeedItems($feed, $expected_count);
$count = $count_query
->execute();
$this
->assertGreaterThan(0, $count);
$this
->deleteFeedItems($feed);
$count = $count_query
->execute();
$this
->assertEquals(0, $count);
}