Skip to content

Commit 5105bdb

Browse files
authored
fix: resolve false positive on jsonMatches (#179)
* Use equals instead of is * Add php input for php cs fixer * Use lowest php version
1 parent 615bed9 commit 5105bdb

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
steps:
2828
- uses: zenstruck/.github/actions/php-cs-fixer@main
2929
with:
30+
php: 8.0
3031
key: ${{ secrets.GPG_PRIVATE_KEY }}
3132
token: ${{ secrets.COMPOSER_TOKEN }}
3233

src/Browser/Json.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __toString(): string
5959
*/
6060
public function assertMatches(string $expression, $expected): self
6161
{
62-
Assert::that($this->search($expression))->is($expected);
62+
Assert::that($this->search($expression))->equals($expected);
6363

6464
return $this;
6565
}

tests/JsonTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,10 @@ public function can_match_json_schema(): void
188188
JSON,
189189
);
190190
}
191+
192+
/** @test */
193+
public function assoc_array_equals()
194+
{
195+
(new Json('{"foo": "bar", "bar": "baz"}'))->assertMatches('@', ['bar' => 'baz', 'foo' => 'bar']);
196+
}
191197
}

0 commit comments

Comments
 (0)