ChartsDefaultColorsTest.php in Charts 5.0.x
File
tests/src/Unit/Settings/ChartsDefaultColorsTest.php
View source
<?php
namespace Drupal\Tests\charts\Unit\Settings;
use Drupal\charts\Settings\ChartsDefaultColors;
use Drupal\Tests\UnitTestCase;
class ChartsDefaultColorsTest extends UnitTestCase {
private $chartsDefaultColors;
public function setUp() {
parent::setUp();
$this->chartsDefaultColors = new ChartsDefaultColors();
}
public function tearDown() {
parent::tearDown();
$this->chartsDefaultColors = NULL;
}
public function testNumberOfDefaultColors() {
$this
->assertCount(10, $this->chartsDefaultColors
->getDefaultColors());
}
public function testDefaultColors(array $color) {
$this->chartsDefaultColors
->setDefaultColors($color);
$this
->assertArrayEquals($color, $this->chartsDefaultColors
->getDefaultColors());
}
public function colorProvider() {
(yield [
[
'#2f7ed8',
],
]);
}
}