You are here

public function FeedProcessorPluginTest::testDelete in Drupal 8

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

Test 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));
}