Skip to content

Commit b294897

Browse files
committed
Fix static method call and allow empty string in $$matchesHexBytes
1 parent e2b6bbb commit b294897

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/UnifiedSpecTests/Constraint/Matches.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ private function assertMatchesOperator(BSONDocument $operator, $actual, string $
253253
assertInternalType('string', $operator['$$matchesEntity'], '$$matchesEntity requires string');
254254

255255
$this->assertMatches(
256-
$this->prepare($this->entityMap[$operator['$$matchesEntity']]),
256+
self::prepare($this->entityMap[$operator['$$matchesEntity']]),
257257
$actual,
258258
$keyPath
259259
);
@@ -263,7 +263,7 @@ private function assertMatchesOperator(BSONDocument $operator, $actual, string $
263263

264264
if ($name === '$$matchesHexBytes') {
265265
assertInternalType('string', $operator['$$matchesHexBytes'], '$$matchesHexBytes requires string');
266-
assertRegExp('/^([0-9a-fA-F]{2})+$/', $operator['$$matchesHexBytes'], '$$matchesHexBytes requires pairs of hex chars');
266+
assertRegExp('/^([0-9a-fA-F]{2})*$/', $operator['$$matchesHexBytes'], '$$matchesHexBytes requires pairs of hex chars');
267267

268268
if (! is_resource($actual) || get_resource_type($actual) != "stream") {
269269
self::failAt(sprintf('%s is not a stream', $this->exporter()->shortenedExport($actual)), $keyPath);

0 commit comments

Comments
 (0)