Skip to content

Commit

Permalink
[BUGFIX] Use compare function for array intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
eliashaeussler authored and renovate[bot] committed Jun 18, 2024
1 parent 76fbd7e commit cc911f5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/src/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
use PHPUnit\Framework;
use Symfony\Component\Finder;

use function array_intersect_assoc;
use function array_uintersect_assoc;
use function class_exists;

/**
Expand Down Expand Up @@ -144,6 +144,13 @@ public static function withRulesAddsRuleDataProvider(): Generator
*/
private function assertRulesAreConfigured(array $rules): void
{
self::assertSame($rules, array_intersect_assoc($this->subject->getRules(), $rules));
self::assertSame(
$rules,
array_uintersect_assoc(
$this->subject->getRules(),
$rules,
static fn (mixed $a, mixed $b) => $a === $b ? 0 : -1,
),
);
}
}

0 comments on commit cc911f5

Please sign in to comment.