-
Notifications
You must be signed in to change notification settings - Fork 266
Add test on UnifiedTestRunner::setEntityMapObserver()
#1129
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
Conversation
$entityMapObserver
in tests
* | ||
* @param callable(EntityMap):void $entityMapObserver | ||
*/ | ||
public function setEntityMapObserver(callable $entityMapObserver): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is called from the PHP workload executor in the Atlas testing project (see: workload-executor.php
).
If you'd like to repurpose this PR you can add a link to the https://github.com/mongodb-labs/drivers-atlas-testing/ repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, it was written in the comment above.
I updated the PR to add link and test this feature.
35349eb
to
6829582
Compare
$entityMapObserver
in testsUnifiedTestRunner::setEntityMapObserver()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a cautionary note about reusing tests ;)
{ | ||
public function testEntityMapObserver(): void | ||
{ | ||
$test = UnifiedTestCase::fromFile(__DIR__ . '/crud/find.json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the sake of completeness, this test might start failing if the crud tests change significantly. Creating a separate test would be safer, but for the sake of getting this method tested (and thus used) this suffices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I'll create a file specifically test the tester.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File added.
6829582
to
0b29bcf
Compare
UnifiedTestRunner::setEntityMapObserver()
is used in `drivers-atlas-testing.