Postponed
Project:
Drupal core
Version:
main
Component:
other
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 Dec 2013 at 18:57 UTC
Updated:
22 Jan 2023 at 07:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ParisLiakos commentedComment #2
dawehnerI don't think that hurts anyone.
Comment #3
jb567 commentedassigning to myself
Comment #4
jb567 commentedComment #5
jb567 commentedComment #6
jb567 commentedHi,
I am new to contributing to open source, but have been using the software for a while, so its time to give back,
This should have renamed all of the @dataprovider 's methods and docblocks to the standard described here,
Thanks,
Jacob
Comment #8
jb567 commentedSorry accidently missed the d in provider in the method providerLocalePageRoutes()
EDIT: Wrong patch name
Comment #9
jb567 commentedCorrect patch name for post number
Comment #10
wiifmMarking 'needs review' to get the test bot to fire
Comment #13
wiifmlooks like a simple typo again -
proivderTaxonomyPageRoutes- note the spelling.Comment #14
jb567 commentedtypo fixed
Comment #15
wiifmHave applied the patch and re-ran the script
grep -nriI "\* @dataProvider" * --exclude-dir=core/vendor | grep -v " provider"No files found that do not conform to the documentation. The method names are mostly a rename of 'get' or 'test' to 'provider' which makes perfect sense.
All phpunit tests pass and the test bot is green. Happy to RTBC this issue.
Comment #16
tim.plunkett#2057905: [policy, no patch] Discuss the standards for phpunit based tests is still a proposal, not policy.
Comment #17
sunFWIW, single-pass, fast PCRE:
Renaming all of those to replace get|test|resolve|route|calculate|form|accept with a "provider" prefix is perfectly sensible, regardless of whether a more granular guideline may be discussed (or not, hopefully). Some affected method names will require manual adjustments.
Status quo, as of now:
Comment #18
sobi3ch commentedComment #19
sobi3ch commentedOK I've tried apply @sun hints..
Comment #20
sobi3ch commentedGo test bot, go!
Comment #21
sobi3ch commentedFixing one naming mistake, so applying updated patch. To be clear I follow @sun mini shell-grep test:
$ grep -r --exclude-dir=vendor --include='*.php' -P '@dataProvider (?!provider)' core/Comment #22
daffie commentedGood work sobo3sh!
Some remarks about your patch:
Comment #23
ankitgarg commentedComment #24
ankitgarg commentedRerolled.
Comment #25
daffie commented@ankitgarg: Can you add an interdiff.txt file. That makes reviewing a lot easier. :-)
Comment #26
ankitgarg commented@daffie: Interdiff.txt Attached for comment #24
Comment #27
daffie commentedHi ankitgarg!
Comment #28
sobi3ch commented@ankitgarg any problems?
Comment #29
sobi3ch commentedComment #30
alvar0hurtad0Rerolled on #24
Comment #31
kyuubi commentedHi guys,
I rerolled the patch as it didn't apply properly anymore and took the chance to address some missing cases in ConfigTest.php as stated in #27.
I also had a look in cases like #22.1 but all the ones I found are exceptions where the dataprovider is used in multiple places.
Also the comments for testRandomStringValidate in TestBaseTest.php seems to be missing since commit 88350da6008f558dcd8f6855a003598e4544c4b8
It's added in this patch, so let me know if it should be removed.
Comment #32
franksj commentedPatch does not apply. :(
Comment #33
rpayanmComment #34
disasm commentedGreat job! Here's 5 more though that need done!
Comment #35
kyuubi commentedHi guys,
Here is another patch addressing #34
Attaching interdiff as well.
Cheers,
Comment #36
disasm commentedComment #39
googletorp commentedRerolled the patch.
Comment #40
googletorp commentedComment #41
fbailey commentedComment #42
fbailey commentedComment #43
fbailey commentedComment #44
cilefen commentedIt still needs a beta evaluation.
Comment #45
fbailey commentedComment #46
fbailey commentedComment #47
fbailey commentedComment #48
cilefen commentedComment #51
xanoThe patch looks good, but it does need a re-roll.
Comment #52
xanoI searched for occurrences of
@dataProvider (?!provider)(a regular expression) in the code base and there are two more incorrect data provider method names left, namely\Drupal\Tests\Core\Cache\CacheContextsTest::validateTokensProvider()and\Drupal\Tests\Core\Validation\Plugin\Validation\Constraint\PrimitiveTypeConstraintValidatorTest::provideTestValidate().Comment #53
nitesh sethia commentedRerolled #42 as per the latest release.
Comment #54
nitesh sethia commentedRemoving Needs reroll tag from this task.
Comment #55
daffie commentedLooks good. Some minor comments:
This can go. The first and the last line are not necessary because of @covers ::randomStringValidate. The parameter definition is not necessary because they are documented with the provider function.
The provider function must be renamed too.
Adding a new test is fine. It just does not belong in this issue.
Comment #56
tomasnagy commentedComment #57
tomasnagy commentedRerolled.
2 files relevant to patch removed:
core/modules/migrate_drupal/tests/src/Unit/MigrationStorageTest.php (from issue #2549013)
core/tests/Drupal/Tests/Core/ContentNegotiationTest.php (from issue #2506533)
Comment #58
tomasnagy commentedRenamed acceptFilterProvider to providerAcceptFilter.
Left docs for testRandomStringValidate().
Comment #59
stefan.r commentedare we still missing these?
Comment #60
tomasnagy commentedRenamed remaining files.
Removed testNodeTypeDataProvider from MigrateNodeTypeTest.php since it's not declared anywhere.
Comment #61
stefan.r commentedLooks like we have them all now, let's see if this comes back green...
Comment #62
daffie commentedAll changes look good to me.
Comment #63
stefan.r commented+1
Comment #65
mgifford@tomasnagy I assume you're not still working on it.
Comment #66
mitrpaka commentedReroll and update.
Comment #67
mitrpaka commentedComment #68
imiksuCleaning up drupalcampfi tags.
Comment #69
googletorp commentedOk, this looks good now, this is RTBC imo.
Comment #71
tstoecklerComment #73
lluvigneRerolled patch #66 . Hope it works this time!
Comment #74
dimaro commentedI manually reviewed the latest patch and looking the scope of the issue all seems to be OK.
RTBC I'd say.
Comment #75
alexpottSo the problem is that #2057905: [policy, no patch] Discuss the standards for phpunit based tests has not been ratified and accepted yet. So making this change is premature. One thing that would be good is to get phpcs rules developed for the proposed standard so that once we've agreed the standard then we can implemented the rules in core and not regress. I realise that this will make the work here seem currently wasted. But the problem with all coding standards outside of the work to enforce them using phpcs.xml.dist is impossible to enforce.
Postponing this issue on #2057905: [policy, no patch] Discuss the standards for phpunit based tests
Comment #84
quietone commentedAdding coding standards tag and changing component to 'other'.
Comment #88
quietone commented