public function test() { $feeds = [$this->getMock('Drupal\\feeds\\FeedInterface')]; $event = new DeleteFeedsEvent($feeds); $this->assertSame($feeds, $event->getFeeds()); }
/** * Deletes subscriptions when feeds are deleted. */ public function onDeleteMultipleFeeds(DeleteFeedsEvent $event) { $subscriptions = $this->storage->loadMultiple(array_keys($event->getFeeds())); foreach ($event->getFeeds() as $feed) { if (!isset($subscriptions[$feed->id()])) { continue; } $this->unsubscribe($feed, $subscriptions[$feed->id()]); } }