You are here

public function AfterParseBaseTest::setUp in Feeds 8.3

Overrides FeedsUnitTestCase::setUp

File

tests/src/Unit/EventSubscriber/AfterParseBaseTest.php, line 45

Class

AfterParseBaseTest
@coversDefaultClass \Drupal\feeds\EventSubscriber\AfterParseBase @group feeds

Namespace

Drupal\Tests\feeds\Unit\EventSubscriber

Code

public function setUp() {
  parent::setUp();

  // Create the event subscriber.
  $this->subscriber = $this
    ->getMockBuilder(AfterParseBase::class)
    ->setMethods([
    'alterItem',
  ])
    ->getMock();

  // Create a parser result.
  $this->parserResult = new ParserResult();

  // Create the event that returns the parser result.
  $this->event = $this
    ->getMockBuilder(ParseEvent::class)
    ->disableOriginalConstructor()
    ->setMethods([
    'getParserResult',
  ])
    ->getMock();
  $this->event
    ->expects($this
    ->any())
    ->method('getParserResult')
    ->willReturn($this->parserResult);
}