public function SyndicationParserTest::setUp in Feeds 8.3
Overrides FeedsUnitTestCase::setUp
File
- tests/
src/ Unit/ Feeds/ Parser/ SyndicationParserTest.php, line 71
Class
- SyndicationParserTest
- @coversDefaultClass \Drupal\feeds\Feeds\Parser\SyndicationParser @group feeds
Namespace
Drupal\Tests\feeds\Unit\Feeds\ParserCode
public function setUp() {
parent::setUp();
$container = new ContainerBuilder();
$manager = new ZfExtensionManagerSfContainer('feed.reader.');
$manager
->setContainer($container);
$manager
->setStandalone(StandaloneExtensionManager::class);
foreach ($this->readerExtensions as $key => $class) {
$container
->set($key, new $class());
}
$container
->set('feed.bridge.reader', $manager);
\Drupal::setContainer($container);
$this->feedType = $this
->createMock('Drupal\\feeds\\FeedTypeInterface');
$configuration = [
'feed_type' => $this->feedType,
];
$this->parser = new SyndicationParser($configuration, 'syndication', []);
$this->parser
->setStringTranslation($this
->getStringTranslationStub());
$this->state = new State();
$this->feed = $this
->createMock('Drupal\\feeds\\FeedInterface');
$this->feed
->expects($this
->any())
->method('getType')
->will($this
->returnValue($this->feedType));
}