diff --git a/tests/Config/ConfigurationTest.php b/tests/Config/ConfigurationTest.php index 0cb8c16..ae83dda 100644 --- a/tests/Config/ConfigurationTest.php +++ b/tests/Config/ConfigurationTest.php @@ -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]);