You are here

private function ChartsBaseSettingsFormTest::getChartsTypeInfoMock in Charts 8.3

Get a charts types info mock.

1 call to ChartsBaseSettingsFormTest::getChartsTypeInfoMock()
ChartsBaseSettingsFormTest::setUp in tests/src/Unit/Settings/ChartsBaseSettingsFormTest.php

File

tests/src/Unit/Settings/ChartsBaseSettingsFormTest.php, line 119

Class

ChartsBaseSettingsFormTest
Tests the ChartsBaseSettingsForm class.

Namespace

Drupal\Tests\charts\Unit\Settings

Code

private function getChartsTypeInfoMock() {
  $chartsTypeInfo = $this
    ->prophesize(ChartsTypeInfo::class);
  $chart_types['area'] = [
    'label' => 'Area',
    'axis' => 'xy',
    'stacking' => TRUE,
  ];
  $chart_types['bar'] = [
    'label' => 'Bar',
    'axis' => 'xy',
    'axis_inverted' => TRUE,
    'stacking' => TRUE,
  ];
  $chart_types['column'] = [
    'label' => 'Column',
    'axis' => 'xy',
    'stacking' => TRUE,
  ];
  $chart_types['donut'] = [
    'label' => 'Donut',
    'axis' => 'y_only',
  ];
  $chart_types['gauge'] = [
    'label' => 'Gauge',
    'axis' => 'y_only',
    'stacking' => FALSE,
  ];
  $chart_types['line'] = [
    'label' => 'Line',
    'axis' => 'xy',
  ];
  $chart_types['pie'] = [
    'label' => 'Pie',
    'axis' => 'y_only',
  ];
  $chart_types['scatter'] = [
    'label' => 'Scatter',
    'axis' => 'xy',
  ];
  $chart_types['spline'] = [
    'label' => 'Spline',
    'axis' => 'xy',
  ];
  $chartsTypeInfo
    ->getChartTypes()
    ->willReturn($chart_types);
  return $chartsTypeInfo
    ->reveal();
}