You are here

public function FeedsExecutableTest::setUp in Feeds 8.3

Overrides FeedsUnitTestCase::setUp

File

tests/src/Unit/FeedsExecutableTest.php, line 42

Class

FeedsExecutableTest
@coversDefaultClass \Drupal\feeds\FeedsExecutable @group feeds

Namespace

Drupal\Tests\feeds\Unit

Code

public function setUp() {
  parent::setUp();
  $entity_type_manager = $this
    ->createMock(EntityTypeManagerInterface::class);
  $this->dispatcher = new EventDispatcher();
  $messenger = $this
    ->createMock(MessengerInterface::class);
  $this->executable = new FeedsExecutable($entity_type_manager, $this->dispatcher, $this
    ->getMockedAccountSwitcher(), $messenger);
  $this->executable
    ->setStringTranslation($this
    ->getStringTranslationStub());
  $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'));
}