Blocks #697760: Replace getInfo() in tests with native phpDoc + annotations (following PHPUnit)
This patch fixes all test classes that are missing phpDoc.
The parent issue will prevent this from happening in the future.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | test.phpdoc.12.patch | 3.56 KB | sun |
| #10 | test.phpdoc.10.patch | 3.55 KB | sun |
| #4 | interdiff.txt | 1.76 KB | sun |
| #4 | test.phpDoc.4.patch | 22.64 KB | sun |
| #2 | interdiff.txt | 3.39 KB | sun |
Comments
Comment #1
jhodgdonThe first few classes in the patch have doc blocks that do not agree with our standards:
- Should start with a verb
- Verb should be 3rd person, like "tests"
- Should be one line and end in sentence, less than 80 characters.
Comment #2
sunFair enough. Fixed those instances.
At least for test classes, we'll soon change our standard for phpDoc summary lines to allow to wrap onto the next line (following PSR-5), but that's for another issue.
This patch obeys the current rule of just one line, not exceeding 80 chars.
Also discovered two more instances in PHPUnit tests after fully completing the new test discovery implementation. — Please note that plenty of our PHPUnit tests are only using
@coversDefaultClassin their phpDoc already, and this patch follows that convention accordingly. The new test discovery automatically converts that information into a "Tests $classname." description in the UI listing.I hope we can get this fix quickly out of the way, because all of these changes are making the new test discovery patch borderline impossible to review (which is why I did not post it yet).
Comment #3
jhodgdonLooks good! Coding standards are OK now. A few typos:
a)
(variable => variables)
b) Capitalization is a bit weird here, is this right?
c) Weird caps here too:
And I'm not sure about committing this quickly... it touches a lot of files. Could be considered "disruptive"?
Comment #4
sunFixed all three points.
Regarding the question of possibly being disruptive: Fair concern. That said, the file headers of existing test classes are usually not touched by other patches (as opposed to the header of files containing functional code), so I'd tentatively say that it shouldn't cause any negative effects on other patches in the queue.
Comment #5
jhodgdonLooks good! I'll let one of the other maintainers commit this, as they can make a better decision on "is this disruptive".
Comment #6
sunComment #7
alexpottCommitted 8494b06 and pushed to 8.x. Thanks!
Changed the file mode back to 644 during commit :)
Comment #10
sunQuick follow-up patch for new instances that were introduced since this patch was committed.
The parent issue will prevent this from happening again in the future.
Comment #11
jhodgdonCould we fix the grammar in this one?
Should have "that" as 2nd word.
Comment #12
sunSure
Comment #13
jhodgdonComment #15
alexpottCommitted d7efdaa and pushed to 8.x. Thanks!