function AggregatorPluginSettingsBaseTest::setUp
Same name in other branches
- 9 core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php \Drupal\Tests\aggregator\Unit\Plugin\AggregatorPluginSettingsBaseTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
modules/ aggregator/ tests/ src/ Unit/ Plugin/ AggregatorPluginSettingsBaseTest.php, line 41
Class
- AggregatorPluginSettingsBaseTest
- Tests settings configuration of individual aggregator plugins.
Namespace
Drupal\Tests\aggregator\Unit\PluginCode
protected function setUp() {
$this->configFactory = $this->getConfigFactoryStub([
'aggregator.settings' => [
'processors' => [
'aggregator_test',
],
],
'aggregator_test.settings' => [],
]);
foreach ([
'fetcher',
'parser',
'processor',
] as $type) {
$this->managers[$type] = $this->getMockBuilder('Drupal\\aggregator\\Plugin\\AggregatorPluginManager')
->disableOriginalConstructor()
->getMock();
$this->managers[$type]
->expects($this->once())
->method('getDefinitions')
->will($this->returnValue([
'aggregator_test' => [
'title' => '',
'description' => '',
],
]));
}
/** @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit\Framework\MockObject\MockBuilder $messenger */
$messenger = $this->createMock(MessengerInterface::class);
$messenger->expects($this->any())
->method('addMessage');
$this->settingsForm = new SettingsForm($this->configFactory, $this->managers['fetcher'], $this->managers['parser'], $this->managers['processor'], $this->getStringTranslationStub());
$this->settingsForm
->setMessenger($messenger);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.