diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4175fe..ca412b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: steps: - uses: zenstruck/.github/actions/php-cs-fixer@main with: + php: 8.0 key: ${{ secrets.GPG_PRIVATE_KEY }} token: ${{ secrets.COMPOSER_TOKEN }} diff --git a/src/Browser/Json.php b/src/Browser/Json.php index 00aa71d..c92f6ce 100644 --- a/src/Browser/Json.php +++ b/src/Browser/Json.php @@ -59,7 +59,7 @@ public function __toString(): string */ public function assertMatches(string $expression, $expected): self { - Assert::that($this->search($expression))->is($expected); + Assert::that($this->search($expression))->equals($expected); return $this; } diff --git a/tests/JsonTest.php b/tests/JsonTest.php index 1b45308..6a6cd95 100644 --- a/tests/JsonTest.php +++ b/tests/JsonTest.php @@ -188,4 +188,10 @@ public function can_match_json_schema(): void JSON, ); } + + /** @test */ + public function assoc_array_equals() + { + (new Json('{"foo": "bar", "bar": "baz"}'))->assertMatches('@', ['bar' => 'baz', 'foo' => 'bar']); + } }