Test config
This commit is contained in:
@@ -36,6 +36,30 @@ class ConfigurationTest extends TestCase
|
||||
$this->validateConfig($config);
|
||||
}
|
||||
|
||||
public function testThrowsIfNoColoursExist(): void
|
||||
{
|
||||
$config = $this->getValidConfig();
|
||||
$config['colours'] = [];
|
||||
$this->expectExceptionMessage("Colours cannot be empty!");
|
||||
$this->validateConfig($config);
|
||||
}
|
||||
|
||||
public function testThrowsIfColourHasMissingClass(): void
|
||||
{
|
||||
$config = $this->getValidConfig();
|
||||
unset($config['colours']['primary']['fill']);
|
||||
$this->expectException(\Exception::class);
|
||||
$this->validateConfig($config);
|
||||
}
|
||||
|
||||
public function testThrowsIfColourHasExtraClass(): void
|
||||
{
|
||||
$config = $this->getValidConfig();
|
||||
$config['colours']['primary']['extra'] = "test";
|
||||
$this->expectException(\Exception::class);
|
||||
$this->validateConfig($config);
|
||||
}
|
||||
|
||||
private function validateConfig(array $config): void
|
||||
{
|
||||
$this->processor->processConfiguration($this->configuration, [$config]);
|
||||
|
||||
Reference in New Issue
Block a user