Needs review
Project:
SimpleTest
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Oct 2012 at 16:14 UTC
Updated:
14 Apr 2021 at 07:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
lars toomre commentedPostponing until #1431636: Clean up API docs for simpletests module (excluding files subdirectory) is committed to D8.
Comment #2
lars toomre commentedHere is a small patch adding type hinting to the missing hooks in simpletest.api.php file.
Comment #3
mile23The blocking issue is marked closed.
Comment #4
yesct commentedI would be willing to review or work on this.
Comment #5
mile23Patch in #2 wouldn't apply, but the changes are reflected here, as well.
Try the API docs, .module file, and unit tests for starters.
Comment #6
filijonka commenteda reroll, mostly removing stuff from the patch cause it's been taken care of already
Comment #11
mile23MOAR.
Note that I kind of generated this in the process: #2403007: Drupal\simpletest\WebTestBase::drupalHead doesn't store results despite documentation..
This patch fixes these files:
Note that I used a phpcs/NetBeans toolchain to find the errors, and you can use it to review the patch, like this: http://youtu.be/H6pWz_6XoiQ
Comment #13
mile23This might be a little out of scope but it solves the issue and improves the documentation.
Comment #15
mile23Comment #16
mile23OK, so it doesn't solve the problem. Reverting back to the original code, changing only the docblock.
Comment #17
mile23Comment #18
mile23Comment #19
mrjmd commentedReroll attached. There were conflicts in WebTestBase.php and simpletest.module, both because a few types in head were being hinted like this:
@param \Drupal\Core\Url|string $pathI switched them to just:
@param string $pathBut I'm not sure that's right. I also fixed a typo from the patch in #16 that had "arrau" instead of array for a type hint for function drupalGet().
Comment #22
daffie commentedThe patch looks good.
In both instances the parameter can be an URL. So can you remove these changes.
Comment #23
mrjmd commentedThanks for the feedback @daffie, I've added those back in and rerolled.
There was one conflict in /core/modules/simpletest/tests/src/Unit/TestBaseTest.php, looks like a method had been renamed while making our fix obsolete.
Comment #24
daffie commentedLooks good to me. Thanks mrjmd for the reroll.
This issue is all about documention of tests. So allowed as a beta change.
Comment #25
mile23Still applies.
Comment #26
mile23Comment #27
alexpottShouldn't we be type-hinting in the function too? Eg:
Also:
Needs a new line before the file doc.
Comment #28
mrjmd commentedI've added typehints to the function names everywhere phpcs pointed them out, and added the new line before the file doc. There are still a lot of other phpcs warnings in simpletest but I didn't want to go out of scope for this issue.
Comment #30
mile23Some of the issues for this meta include type hinting in the function signatures, some don't.
My understanding is that ones which do not can be documentation issues, whereas ones which do are code changes. A maintainer could please talk about such a distinction on the meta if it matters.
Comment #31
deepakaryan1988Comment #32
deepakaryan1988Re-rolling the patch#28
Comment #33
deepakaryan1988Comment #35
mile23All docblock @param and @return filled in.
Running the phpcs gist in the issue summary only yields one false-positive CS error. (It's complaining about the lack of description in a @param, but the type hinting is there.)
Comment #37
mile23Turns out we can get documentation into 8.0.x.
Needed a re-roll, but I couldn't get that to work easily, so I used
git apply --rejectand re-did the other work. This only affectedWebTestBase.php.phpcs reports only one false-positive of a @param without a comment.
Comment #42
mile23Comment #43
mile23There's another issue for base test classes, which are arguably more important: #1805346: Add missing type hinting to base test classes in Simpletest module docblocks
Comment #49
snehalgaikwad commentedComment #50
quietone commentedThe simpletest module is no longer in core, moving to the SimpleTest project.
Comment #51
quietone commentedIt doesn't seem to make sense to have this as a child of a core issue, so removing parent.