Skip to content

Commit dc1bb17

Browse files
committed
PHPLIB-887: Allow extra fields in find results
Most operations that use ASSERT_SAME_DOCUMENT and ASSERT_SAME_DOCUMENTS should technically use ASSERT_MATCHES_DOCUMENT and ASSERT_DOCUMENTS_MATCH, respectively; however, this is the minimum change needed to satisfy new CSFLE spec tests.
1 parent ff1e3fa commit dc1bb17

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/SpecTests/FunctionalTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static function assertCommandReplyMatches(stdClass $expected, stdClass $a
8989
* @param array|object $actualDocument
9090
* @param string $message
9191
*/
92-
protected static function assertDocumentsMatch($expectedDocument, $actualDocument, string $message = ''): void
92+
public static function assertDocumentsMatch($expectedDocument, $actualDocument, string $message = ''): void
9393
{
9494
$constraint = new DocumentsMatchConstraint($expectedDocument, true, true);
9595

tests/SpecTests/Operation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,10 @@ private function getResultAssertionTypeForCollection()
774774
case 'findOneAndDelete':
775775
case 'findOneAndReplace':
776776
case 'findOneAndUpdate':
777-
return ResultExpectation::ASSERT_SAME_DOCUMENT;
777+
return ResultExpectation::ASSERT_MATCHES_DOCUMENT;
778778

779779
case 'find':
780-
return ResultExpectation::ASSERT_SAME_DOCUMENTS;
780+
return ResultExpectation::ASSERT_DOCUMENTS_MATCH;
781781

782782
case 'insertMany':
783783
return ResultExpectation::ASSERT_INSERTMANY;

0 commit comments

Comments
 (0)