Skip to content

Commit 369a6f3

Browse files
committed
Todo items for Matches constraint
1 parent ec1db18 commit 369a6f3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/UnifiedSpecTests/Constraint/Matches.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ public function evaluate($other, $description = '', $returnResult = false)
9393
$this->lastFailure = new ComparisonFailure(
9494
$this->value,
9595
$other,
96+
/* TODO: Improve the exporter to canonicalize documents by
97+
* sorting keys and remove spl_object_hash from output. */
9698
$this->exporter()->export($this->value),
9799
$this->exporter()->export($other),
98100
false,
@@ -255,6 +257,9 @@ private function assertMatchesOperator(BSONDocument $operator, $actual, string $
255257
if ($name === '$$matchesEntity') {
256258
assertInternalType('string', $operator['$$matchesEntity'], '$$matchesEntity requires string');
257259

260+
/* TODO: Consider including the entity ID in any error message to
261+
* assist with diagnosing errors. Also consider disabling operators
262+
* within this match, since entities are unlikely to use them. */
258263
$this->assertMatches(
259264
self::prepare($this->entityMap[$operator['$$matchesEntity']]),
260265
$actual,

0 commit comments

Comments
 (0)