diff --git a/tests/src/Kernel/Entity/FeedTest.php b/tests/src/Kernel/Entity/FeedTest.php index 4ecf50e..99ada4a 100644 --- a/tests/src/Kernel/Entity/FeedTest.php +++ b/tests/src/Kernel/Entity/FeedTest.php @@ -209,8 +209,6 @@ class FeedTest extends FeedsKernelTestBase { // Start batch expire. $feed->startBatchExpire(); - // @todo Repaire expire functionality. - $this->markTestIncomplete('The expire functionality is not working yet.'); // Assert that still no batch was created, since there was nothing to // expire. $this->assertEquals([], batch_get()); diff --git a/tests/src/Kernel/Feeds/Processor/EntityProcessorBaseTest.php b/tests/src/Kernel/Feeds/Processor/EntityProcessorBaseTest.php index e319d78..46324fb 100644 --- a/tests/src/Kernel/Feeds/Processor/EntityProcessorBaseTest.php +++ b/tests/src/Kernel/Feeds/Processor/EntityProcessorBaseTest.php @@ -301,7 +301,6 @@ class EntityProcessorBaseTest extends FeedsKernelTestBase { * @covers ::getExpiredIds */ public function testGetExpiredIds() { - $this->markTestIncomplete('Test not yet implemented.'); $this->processor->getExpiredIds($this->feed); } @@ -309,7 +308,6 @@ class EntityProcessorBaseTest extends FeedsKernelTestBase { * @covers ::expireItem */ public function testExpireItem() { - $this->markTestIncomplete('Test not yet implemented.'); $item_id = 1; $this->processor->expireItem($this->feed, $item_id, $this->state); } diff --git a/tests/src/Unit/FeedExpireHandlerTest.php b/tests/src/Unit/FeedExpireHandlerTest.php index ee24a77..8fa3863 100644 --- a/tests/src/Unit/FeedExpireHandlerTest.php +++ b/tests/src/Unit/FeedExpireHandlerTest.php @@ -4,6 +4,8 @@ namespace Drupal\Tests\feeds\Unit; use Drupal\feeds\Event\FeedsEvents; use Drupal\feeds\FeedExpireHandler; +use Drupal\feeds\FeedInterface; +use Drupal\feeds\State; use Symfony\Component\EventDispatcher\EventDispatcher; /** @@ -33,22 +35,24 @@ class FeedExpireHandlerTest extends FeedsUnitTestCase { parent::setUp(); $this->dispatcher = new EventDispatcher(); - $this->feed = $this->getMock('Drupal\feeds\FeedInterface'); + $this->feed = $this->getMock(FeedInterface::class); } /** * @covers ::startBatchExpire */ public function testBatchExpire() { - $this->markTestIncomplete('The expire functionality is not working yet.'); + $this->feed->expects($this->once()) + ->method('lock') + ->will($this->returnValue($this->feed)); + + $this->handler->startBatchExpire($this->feed); } /** * @covers ::expireItem */ public function testExpireItem() { - $this->markTestIncomplete('The expire functionality is not working yet.'); - $this->feed ->expects($this->exactly(2)) ->method('progressExpiring') @@ -68,7 +72,15 @@ class FeedExpireHandlerTest extends FeedsUnitTestCase { * @covers ::postExpire */ public function testPostExpire() { - $this->markTestIncomplete('The expire functionality is not working yet.'); + $state = new State(); + $state->total = 1; + + $this->feed->expects($this->once()) + ->method('getState') + ->will($this->returnValue($state)); + + $this->handler->postExpire($this->feed); + // @todo assert set message. } /** @@ -76,8 +88,6 @@ class FeedExpireHandlerTest extends FeedsUnitTestCase { * @expectedException \Exception */ public function testException() { - $this->markTestIncomplete('The expire functionality is not working yet.'); - $this->dispatcher->addListener(FeedsEvents::EXPIRE, function ($event) { throw new \Exception(); });