You are here

public function FeedExpireHandlerTest::testExpireItemWithException in Feeds 8.3

@covers ::expireItem

File

tests/src/Unit/FeedExpireHandlerTest.php, line 89

Class

FeedExpireHandlerTest
@coversDefaultClass \Drupal\feeds\FeedExpireHandler @group feeds

Namespace

Drupal\Tests\feeds\Unit

Code

public function testExpireItemWithException() {
  $this->dispatcher
    ->addListener(FeedsEvents::EXPIRE, function ($event) {
    throw new \Exception();
  });
  $this->feed
    ->expects($this
    ->once())
    ->method('clearStates');
  $this
    ->expectException(\Exception::class);
  $this->handler
    ->expireItem($this->feed, 1);
}