You are here

protected function FeedsExUnitTestBase::getMockFeedsSource in Feeds extensible parsers 7.2

Returns a mocked FeedsSource object.

Parameters

string $fetcher: (optional) The fetcher class. Defaults to FeedsFileFetcher

string $processor: (optional) The processor class. Defaults to FeedsNodeProcessor.

Return value

FeedsSource The mocked FeedsSource object,

8 calls to FeedsExUnitTestBase::getMockFeedsSource()
FeedsExHtmlUnitTests::setUp in src/Tests/FeedsExHtml.test
FeedsExJmesPathLinesUnitTests::setUp in src/Tests/FeedsExJmesPathLines.test
FeedsExJmesPathUnitTests::setUp in src/Tests/FeedsExJmesPath.test
FeedsExJsonPathLinesUnitTests::setUp in src/Tests/FeedsExJsonPathLines.test
FeedsExJsonPathUnitTests::setUp in src/Tests/FeedsExJsonPath.test

... See full list

File

src/Tests/FeedsExUnitTests.test, line 55
Contains unit tests for feeds_ex.

Class

FeedsExUnitTestBase
Base class for units tests.

Code

protected function getMockFeedsSource($fetcher = 'FeedsFileFetcher', $processor = 'FeedsNodeProcessor') {
  $importer = $this
    ->newInstanceWithoutConstructor('FeedsImporter');
  $fetcher = $this
    ->newInstanceWithoutConstructor($fetcher);
  $this
    ->setProperty($importer, 'fetcher', $fetcher);
  $processor = $this
    ->newInstanceWithoutConstructor($processor);
  $this
    ->setProperty($importer, 'processor', $processor);
  $source = $this
    ->newInstanceWithoutConstructor('FeedsSource');
  $this
    ->setProperty($source, 'importer', $importer);
  return $source;
}