You are here

protected function AggregatorPluginSettingsBaseTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 45
Contains \Drupal\Tests\aggregator\Unit\Plugin\AggregatorPluginSettingsBaseTest.

Class

AggregatorPluginSettingsBaseTest
Tests settings configuration of individual aggregator plugins.

Namespace

Drupal\Tests\aggregator\Unit\Plugin

Code

protected function setUp() {
  $this->configFactory = $this
    ->getConfigFactoryStub(array(
    'aggregator.settings' => array(
      'processors' => array(
        'aggregator_test',
      ),
    ),
    'aggregator_test.settings' => array(),
  ));
  foreach (array(
    '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(array(
      'aggregator_test' => array(
        'title' => '',
        'description' => '',
      ),
    )));
  }
  $this->settingsForm = new SettingsForm($this->configFactory, $this->managers['fetcher'], $this->managers['parser'], $this->managers['processor'], $this
    ->getStringTranslationStub());
}