You are here

public function FeedExpireHandlerTest::testExpireItem in Feeds 8.3

@covers ::expireItem

File

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

Class

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

Namespace

Drupal\Tests\feeds\Unit

Code

public function testExpireItem() {
  $this->feed
    ->expects($this
    ->exactly(2))
    ->method('progressExpiring')
    ->will($this
    ->onConsecutiveCalls(0.5, 1.0));
  $result = $this->handler
    ->expireItem($this->feed, 1);
  $this
    ->assertSame($result, 0.5);
  $result = $this->handler
    ->expireItem($this->feed, 2);
  $this
    ->assertSame($result, 1.0);
}