You are here

public function LazySubscriberTest::setUp in Feeds 8.3

Overrides FeedsUnitTestCase::setUp

File

tests/src/Unit/EventSubscriber/LazySubscriberTest.php, line 83

Class

LazySubscriberTest
@coversDefaultClass \Drupal\feeds\EventSubscriber\LazySubscriber @group feeds

Namespace

Drupal\Tests\feeds\Unit\EventSubscriber

Code

public function setUp() {
  parent::setUp();
  $this->dispatcher = new EventDispatcher();

  // Dispatcher used to verify things only get called once.
  $this->explodingDispatcher = $this
    ->createMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
  $this->explodingDispatcher
    ->expects($this
    ->any())
    ->method('addListener')
    ->will($this
    ->throwException(new \Exception()));
  $this->state = $this
    ->createMock('Drupal\\feeds\\StateInterface');
  $this->feed = $this
    ->createMock('Drupal\\feeds\\FeedInterface');
  $this->feed
    ->expects($this
    ->any())
    ->method('getState')
    ->will($this
    ->returnValue($this->state));
  $this->feedType = $this
    ->createMock('Drupal\\feeds\\FeedTypeInterface');
  $this->feedType
    ->expects($this
    ->any())
    ->method('getMappedSources')
    ->will($this
    ->returnValue([]));
  $this->fetcher = $this
    ->createMock('Drupal\\feeds\\Plugin\\Type\\Fetcher\\FetcherInterface');
  $this->parser = $this
    ->createMock('Drupal\\feeds\\Plugin\\Type\\Parser\\ParserInterface');
  $this->processor = $this
    ->createMock('Drupal\\feeds\\Plugin\\Type\\Processor\\ProcessorInterface');
  $this->feed
    ->expects($this
    ->any())
    ->method('getType')
    ->will($this
    ->returnValue($this->feedType));
}