Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
admin/structure/block/demo has no test coverage.
Beta phase evaluation
Issue category | Task because it adds tests. |
---|---|
Issue priority | Normal because it adds a test for working but untested code. |
Unfrozen changes | Unfrozen because it only changes tests. |
Proposed resolution
Add test coverage with different themes, including testing the default theme, and ensure the link for "Exit block region demonstration" uses "admin/structure/blocks"
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#33 | interdiff-2352791-32-33.txt | 800 bytes | naveenvalecha |
#33 | 2352791-33.patch | 2.17 KB | naveenvalecha |
Comments
Comment #1
rosinegrean CreditAttribution: rosinegrean commentedComment #2
rosinegrean CreditAttribution: rosinegrean commentedComment #3
tim.plunkettGreat work @prics! Just a couple nits
This should be "Contains \Drupal" instead of "Definition of Drupal"
Let's rename this BlockDemoTest (remember to change the @file part too)
Please make this
public function testBlockDemo
This is correct, but can we add
$this->assertNoLinkByHref('admin/structure/block/list/' . $default_theme);
on the next line to be sure?These should be asserting admin/structure/block/list/bartik for the first and admin/structure/block/list/seven for the second, not just the short path
Comment #4
rosinegrean CreditAttribution: rosinegrean commentedComment #5
skipyT CreditAttribution: skipyT commentedLooks nice, only one thing spotted:
This should be 'Contains \Drupal...' not 'Contains of Drupal'
Comment #6
rosinegrean CreditAttribution: rosinegrean commentedComment #7
skipyT CreditAttribution: skipyT commentedComment #8
alexpottThe default theme is already installed.
Why do we need to set the admin theme?
Comment #9
dstotijn CreditAttribution: dstotijn commentedUpdated patch from #6 based on comments from alexpott in #8. No need to install default theme. No need to set admin theme. Refactored code to loop through all available themes and perform assertions.
Comment #10
YesCT CreditAttribution: YesCT commentedComment #11
wheatpenny CreditAttribution: wheatpenny commentedAdded beta evaluation
Comment #12
joshi.rohit100I think, we should use the short array synatx (as new patch policy).
Comment #14
sam0971 CreditAttribution: sam0971 at iO commentedI updated the patch with the short array syntax.
Comment #17
sam0971 CreditAttribution: sam0971 at iO commentedUpdated the patch so it includes the whole file now.
Comment #18
sam0971 CreditAttribution: sam0971 at iO commentedHided the wrong patch.
Comment #19
sam0971 CreditAttribution: sam0971 at iO commentedComment #21
Mile23Nice. Pretty sure this can be in 8.1.x because it's a test.
Restarting the testbot for the patch in #17. The test passes locally.
Here's a review:
We don't do 'Contains' anymore, so remove the @file section.
Should be $this->container->get('config.factory')->get('system.theme');
Should be $this->container->get() instead of \Drupal::service().
Comment #23
ashishdalviComment #24
ashishdalviHi Mile23,
Thanks for suggestions.
I have worked on changes mentioned above. Added patch and interdiff.
Comment #25
naveenvalechaThat's a F/R can we bump this to 8.2.x and directly write the BTB instead of WTB ?
Comment #26
mparker17Unassigning because no work has been done on it for almost 4 weeks. Also, I'm hoping that someone will be able to review this at the Drupal North 2016 code sprint tomorrow.
@Ashish.Dalvi, if you are still working on this issue, please re-assign it to yourself.
Comment #27
mparker17Not sure what the abbreviation "BTB" means, but I think "F/R" = "Feature Request" and "WTB" = "Web Test Base".
Comment #28
Mile23Right, BrowserTestBase and WebTestBase.
Not sure about what 'F/R' means because this isn't a feature request. Maybe @naveenvalecha can clarify.
It should be 8.1.x because it's a test improvement. The new test should pass both 8.1.x and 8.2.x.
Comment #29
naveenvalecha@Mile23,
Yup F/R refers to the feature request.
however if its not a FR then its good to review.
Comment #32
ZeiP CreditAttribution: ZeiP as a volunteer commentedAttached is a new patch with just one newline added for code style. Otherwise looked good.
Comment #33
naveenvalechaWe're not adding more WTB tests b/c it would be the duplicate efforts than in conversion
//Naveen
Comment #34
ZeiP CreditAttribution: ZeiP as a volunteer commentedLooks good and works, marking RTBC.
Comment #36
catchCommitted/pushed to 8.4.x and cherry-picked to 8.3.x, thanks!