Skip to content

PHPLIB-1071: Do not create ECC collection and check wire version for QEv2 #1084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 31, 2023

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented May 30, 2023

@jmikola jmikola requested a review from GromNaN May 30, 2023 11:25
jmikola added 3 commits May 31, 2023 12:40
The original logic in the Transactions legacy test runner only handled assertions for top-level fields. This adds logic to check fields within embedded documents, as needed by the CSFLE tests.
continue;
}

if ($value instanceof stdClass && property_exists($actual, $key) && $actual->{$key} instanceof stdClass) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: the previous code for this function was:

if ($value instanceof stdClass) {
    static::assertObjectHasAttribute($key, $actual);
    static::assertInstanceOf(stdClass::class, $actual->{$key});
    static::assertCommandOmittedFields($value, $actual->{$key});
}

This caused multiple test failures in the getMore.json test, which asserts that the getMore field of the outgoing command matches { "$$type": "long" }. The actual value in that case is an integer, which was problematic for assertInstanceOf() above.

Rather than rewrite assertCommandOmittedFields() to skip special operations (i.e. keys starting with "$$"), which is only defined in the CSFLE legacy test format, I opted to just NOP and avoid recursion. This keeps assertCommandOmittedFields() focused on it's original purpose of only asserting omitted fields and allows the caller to handle everything else (likely via assertDocumentsMatch()).

@jmikola jmikola merged commit d95e762 into mongodb:master May 31, 2023
@jmikola jmikola deleted the phplib-1071 branch May 31, 2023 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants