You are here

public function FeedProcessorPluginTest::testDelete in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/aggregator/tests/src/Functional/FeedProcessorPluginTest.php \Drupal\Tests\aggregator\Functional\FeedProcessorPluginTest::testDelete()

Tests deleting functionality.

File

core/modules/aggregator/tests/src/Functional/FeedProcessorPluginTest.php, line 48

Class

FeedProcessorPluginTest
Tests the processor plugins functionality and discoverability.

Namespace

Drupal\Tests\aggregator\Functional

Code

public function testDelete() {
  $feed = $this
    ->createFeed();
  $description = $feed->description->value ?: '';
  $this
    ->updateAndDelete($feed, NULL);

  // Make sure the feed title is changed.
  $entities = \Drupal::entityTypeManager()
    ->getStorage('aggregator_feed')
    ->loadByProperties([
    'description' => $description,
  ]);
  $this
    ->assertTrue(empty($entities));
}