Needs work
Project:
Drupal core
Version:
main
Component:
language system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Apr 2020 at 21:10 UTC
Updated:
20 Mar 2023 at 02:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
stefanos.petrakisHere is a patch with 5 unit test cases; at the moment it is however blocked by #3130438: Inject page_cache_kill_switch service to LanguageNegotiationBrowser
Comment #3
jungleThank you @stefanos.petrakis!
See #3107732: Add return typehints to setUp/tearDown methods in concrete test classes, return type hinting is expected in 9.x now
Prefer using Prophecy for mocking, see https://www.drupal.org/docs/8/phpunit/using-prophecy, but it's ok to not use it. Non-mandatory.
Code here is self-explained. To me, comments are unnecessary, but it's ok to keep it if you like.
Comment #4
jungleSwitching to 9.1.x, could be backported to 8.x
Comment #5
stefanos.petrakisThanks for the review, here is the updated patch.
Comment #7
stefanos.petrakisRight, working on different issues got me a tiny bit confused.
The latest patch (#5) will fail till #3130438: Inject page_cache_kill_switch service to LanguageNegotiationBrowser lands.
In the meantime, here is a combined patch of the constuctor-DI mods to the LanguageNegotiationBrowser together with the Unit tests, for proof of the tests working nicely together when constructor-DI is implemented.
Comment #8
andypostYep, better to fix injection instead of mocking Drupal::service()
Comment #9
andypostBlocker is in
Comment #10
andypostLooks it needs to re-upload patch 5, requeued
Comment #11
andypostbtw Looking on test coverage it looks better to create base test-class or trait with a method to create plugins via factory
Comment #12
andypostThe plugin must get configuration into constructor, so test coverage should catch it
Comment #19
stefanos.petrakisPicking this up again, following comments from @andypost and using a PR for the work from this point on.
Waiting for the bot to approve so this can move into NR.
Comment #20
stefanos.petrakisComment #21
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
Scratched out the remaining tasks as they appear to be completed. The MR contains the test for getLangCode().
Coverage looks good
Comment #22
quietone commentedComment #23
stefanos.petrakisThanks for the review @quietone; I believe I responded to all points adequately
Comment #24
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #25
stefanos.petrakisComment #26
smustgrave commentedFew small things but overall looks close.
Comment #27
stefanos.petrakisRefactored into a yet simpler form, I think this may be it.
Comment #28
smustgrave commentedAppears @jungle has one open thread if that can be answered.
Other then that looks good!
Comment #29
stefanos.petrakisReplied to the thread from @jungle (thanks, good shout). Setting this back to NR
Comment #30
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #31
stefanos.petrakisDisagreeing with the "Needs Review Queue Bot"
Comment #32
smustgrave commentedSeeing some weirdness myself.
Opening MR 2900 I see there are 30 files changed.
Clicking file tab I see 2
If I go to https://git.drupalcode.org/project/drupal/-/merge_requests/2900.diff I see TONS of changes.
Comment #33
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #36
stefanos.petrakisAgain, (in a new MR due to some issues with Gitlab's UI and the git history in the old branch), this is open for review.
The remaining open point from @jungle has been addressed.
Comment #37
smustgrave commentedSeems to be good now but think this maybe should be postponed for #3130107: Extend unit test coverage for LanguageNegotiationContentEntity since the fixes intersect. This will have to be reviewed again when #3130107: Extend unit test coverage for LanguageNegotiationContentEntity lands
Comment #38
quietone commentedI was looking at this again and this appears to be a duplicate of #3130751: Fix LanguageNegotiationContentEntity::getLangcode() errors thrown, which was committed last month. Looking more closely at the test cases I think this is adding some, such as
I think what needs to happen is to improve the testing in the existing \Drupal\Tests\language\Unit\Plugin\LanguageNegotiation\LanguageNegotiationContentEntityTest with any tests cases that are new here.