-
Notifications
You must be signed in to change notification settings - Fork 185
Allow getting type from define() node #363
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
Codecov Report
@@ Coverage Diff @@
## master #363 +/- ##
============================================
+ Coverage 84.11% 84.33% +0.22%
- Complexity 826 834 +8
============================================
Files 59 59
Lines 1712 1724 +12
============================================
+ Hits 1440 1454 +14
+ Misses 272 270 -2
|
Would it be possible to add a test that fails before the changes to prevent a regression? |
Sure. Should I maybe add a folder for bugfixes? |
No, all tests are to prevent regressions. A test should not be coupled to a specific "bug", it should assert that the program behaves correctly. |
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.
Thanks for adding unit tests to DefinitionResolver, long overdue!
tests/DefinitionResolverTest.php
Outdated
|
||
public function testGetDefinedFqn() | ||
{ | ||
// define('XXX') (only one argument) must not introduce a new symbol |
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.
There should also be a test for the normal case
* Allow getting type from define() node - fixes felixfbecker#364 * Add test case for DefinitionResolver
* Allow getting type from define() node - fixes felixfbecker#364 * Add test case for DefinitionResolver
fixes #364
DefinitionResolver::getTypeFromNode()
was missing a case fordefine()
function call nodes.This caused the stubs file to contain lots of constants without an associated type.
Added the missing case and added checks to other parts concerning
define()
nodes so that incomplete defines (only one argument) are not resolved as constants.