-
Notifications
You must be signed in to change notification settings - Fork 202
Test framework #489
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
Test framework #489
Conversation
Codecov Report
@@ Coverage Diff @@
## 8.x-3.x #489 +/- ##
===========================================
- Coverage 82.14% 81.42% -0.73%
===========================================
Files 243 235 -8
Lines 3714 4081 +367
===========================================
+ Hits 3051 3323 +272
- Misses 663 758 +95
Continue to review full report at Codecov.
|
tests/src/Traits/MockSchemaTrait.php
Outdated
if ($this instanceof KernelTestBase) { | ||
$this->schemaManagerProphecy = $this->prophesize(SchemaPluginManager::class); | ||
|
||
$that = $this; |
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.
Why is this required?
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.
The prophecy callback is bound to the prophecy object, so $this
won't work. But perhaps there's a more elegant way around this.
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.
Interesting. Do they somehow overwrite the normal context (which is "$this from the place you create the closure in") through reflection?
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.
It uses Closure::bind
. We could just introduce our own callback promise to avoid that.
tests/src/Traits/MockSchemaTrait.php
Outdated
} | ||
|
||
protected function registerSchemaPluginManager(ContainerBuilder $container) { | ||
if ($this instanceof KernelTestBase) { |
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.
Why do we need this check?
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.
Because somebody might attach this to something else than a KernelTest. And PHPStorm gives me autocompletion this way 😛
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.
Right but then just use the /** typehint (via comments)?
|
||
protected function registerTypeSystemPluginManagers(ContainerBuilder $container) { | ||
if ($this instanceof KernelTestBase) { | ||
$that = $this; |
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.
Same here? Why is this needed?
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.
see above
Moved response cache metadata merge to query processor level.
# Conflicts: # src/EventSubscriber/CacheSubscriber.php # src/GraphQL/Execution/QueryProcessor.php
@fubhy Finally done. The base module tests are all ported too. |
This looks AMAZING @pmelab |
Nice work! @pmelab specifically pointed me to
|
|
No description provided.