Skip to content

Commit

Permalink
Fix config validation is keys are used defining the "root_sass" paths
Browse files Browse the repository at this point in the history
  • Loading branch information
evertharmeling committed Nov 23, 2023
1 parent b942232 commit 32a8ca3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/DependencyInjection/SymfonycastsSassExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->end()
->validate()
->ifTrue(static function (array $paths): bool {
if (1 === \count($paths)) {
if (1 === \count($paths) || !array_is_list($paths)) {
return false;
}

Expand Down
12 changes: 12 additions & 0 deletions tests/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ public function testMultipleSassRootPaths(): void
]);
}

public function testMultipleSassRootPathsWithIdentifier(): void
{
$this->assertConfigurationIsValid([
'symfonycasts_sass' => [
'root_sass' => [
'website' => '%kernel.project_dir%/assets/scss/app.scss',
'admin' => '%kernel.project_dir%/assets/admin/scss/app.scss',
],
],
]);
}

public function testMultipleSassRootPathsWithSameFilename(): void
{
$this->assertConfigurationIsInvalid([
Expand Down

0 comments on commit 32a8ca3

Please sign in to comment.