You are here

public function FeedImportHandlerTest::setUp in Feeds 8.3

Overrides FeedsUnitTestCase::setUp

File

tests/src/Unit/FeedImportHandlerTest.php, line 41

Class

FeedImportHandlerTest
@coversDefaultClass \Drupal\feeds\FeedImportHandler @group feeds

Namespace

Drupal\Tests\feeds\Unit

Code

public function setUp() {
  parent::setUp();
  $this->dispatcher = new EventDispatcher();
  $this->handler = $this
    ->getMockBuilder(FeedImportHandler::class)
    ->setConstructorArgs([
    $this->dispatcher,
  ])
    ->setMethods([
    'getRequestTime',
    'getExecutable',
  ])
    ->getMock();
  $this->handler
    ->setStringTranslation($this
    ->getStringTranslationStub());
  $this->handler
    ->expects($this
    ->any())
    ->method('getRequestTime')
    ->willReturn(time());
  $this->feed = $this
    ->createMock(FeedInterface::class);
  $this->feed
    ->expects($this
    ->any())
    ->method('id')
    ->will($this
    ->returnValue(10));
  $this->feed
    ->expects($this
    ->any())
    ->method('bundle')
    ->will($this
    ->returnValue('test_feed'));
}