You are here

private function ChartsSettingsServiceTest::createChartsSettingsService in Charts 5.0.x

Same name and namespace in other branches
  1. 8.4 tests/src/Unit/Services/ChartsSettingsServiceTest.php \Drupal\Tests\charts\Unit\Services\ChartsSettingsServiceTest::createChartsSettingsService()
  2. 8.3 tests/src/Unit/Services/ChartsSettingsServiceTest.php \Drupal\Tests\charts\Unit\Services\ChartsSettingsServiceTest::createChartsSettingsService()

Create a ChartsSettingsService object.

Parameters

array $config: A default module configuration.

Return value

\Drupal\charts\Services\ChartsSettingsService ChartsSettingsService object to be tested.

1 call to ChartsSettingsServiceTest::createChartsSettingsService()
ChartsSettingsServiceTest::testGetChartsSettings in tests/src/Unit/Services/ChartsSettingsServiceTest.php
Tests if the default chart settings are available.

File

tests/src/Unit/Services/ChartsSettingsServiceTest.php, line 53

Class

ChartsSettingsServiceTest
@coversDefaultClass \Drupal\charts\Services\ChartsSettingsService @group charts

Namespace

Drupal\Tests\charts\Unit\Services

Code

private function createChartsSettingsService(array $config) {
  return new ChartsSettingsService($this
    ->getConfigFactoryStub([
    'charts.settings' => [
      'charts_default_settings' => $config,
    ],
  ]));
}