- πΊπΈUnited States Amber Himes Matz Portland, OR USA
Working on this. Looks like I can use
Drupal\Tests\Core\Utility\LinkGeneratorTest
for guidance. - π«π·France andypost
Good idea π looks that one is primary blocker
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 6:07am 29 April 2023 - last update
over 1 year ago 29,361 pass, 2 fail - πΊπΈUnited States Amber Himes Matz Portland, OR USA
According to the IS, there are 3 objectives. The only thing missing from
HelpTopicsSyntaxTest
(as far as I could tell) was a check for use ofurl()
. I happened to have a month-old pull of 10.1.x which had 2 core help topics that still usedurl()
(i.e.{% set search_url = render_var(url('search.view')) %}
) and my update to this test caught them. (It doesn't catch all of them at once, just the first one it finds. When that one is fixed, then it would catch the next failure.)1. Both help_topic_link and help_route_link functions are being used for links and not the base Twig url() function.
- I added a string-match check in
HelpTopicsSyntaxTest::verifyTopic()
to see ifurl(
was found. I didn't know how to explicitly check for use of a certain function in this testing framework. So I hope that string-match type of check will suffice here.
- I added a "bad topic" (core/modules/help_topics/tests/modules/help_topics_test/bad_help_topics/syntax/bad_help_topics.url_func_used.html.twig) that usesurl()
- I added a case toHelpTopicsSyntaxTest::verifyBadTopic()
that verifies that the new bad topic fails as expected.
- There is already a test topic (core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics_test.test_urls.html.twig) that useshelp_route_link()
andhelp_topic_link()
in various ways and tests them inHelpTopicsSyntaxTest::verifyTopic()
2. If help_route_link or help_topic_link is used, the text is translated.
- This appears to be covered already with
HelpTopicsSyntaxTest::verifyTopic()
as it checks core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics_test.test_urls.html.twig3. The syntax test includes "bad" examples to verify the tests are working, so there should also be "bad" examples added that violate those two test cases, to make sure the test is working properly.
- This appears to be covered already with
HelpTopicsSyntaxTest::verifyTopic()
as it checks core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics_test.test_urls.html.twigI'm also working on a unit test to cover
HelpTwigExtension::getRouteLink()
andHelpTwigExtension::getTopicLink()
but I'm struggling. Maybe it's something we can add later and isn't necessary for this issue, as it isn't in the original scope. (I can open a follow-up issue if it seems like a good idea to others.) The last submitted patch, 9: 3219923-9.patch, failed testing. View results β
- last update
over 1 year ago 29,366 pass - πΊπΈUnited States Amber Himes Matz Portland, OR USA
Re-testing the patch as test failure looked like an infrastructure error and not an error from the patch.
- π«π·France andypost
It looks great and solves the issue but follow-up is required for twig functions,
\Drupal\Tests\Core\Template\TwigExtensionTest::testFileUrl()
could be used as example, I'm fine with follow-up - Status changed to RTBC
over 1 year ago 11:18am 30 April 2023 - π«π·France andypost
Re-reading #3090659-93: Make a way for help topics to generate links only if they work and are accessible β I see that we have extensive functional testing coverage and the scope of the issue is to check all shipped topics has no usage of
url(
Also I found no requirement to have unit test and moreover, this class will be moved to help module π Finalize the merge of Help Topics into Help Fixed
- last update
over 1 year ago 29,367 pass - last update
over 1 year ago 29,374 pass - last update
over 1 year ago 29,378 pass - last update
over 1 year ago 29,379 pass - last update
over 1 year ago 29,380 pass - last update
over 1 year ago 29,383 pass - last update
over 1 year ago 29,388 pass - last update
over 1 year ago 29,387 pass, 2 fail The last submitted patch, 9: 3219923-9.patch, failed testing. View results β
- last update
over 1 year ago 29,388 pass - last update
over 1 year ago 29,388 pass - last update
over 1 year ago 29,388 pass - last update
over 1 year ago 29,395 pass - last update
over 1 year ago 29,395 pass - last update
over 1 year ago 29,399 pass - last update
over 1 year ago 29,399 pass - last update
over 1 year ago 29,400 pass - last update
over 1 year ago 29,409 pass - Open on Drupal.org βEnvironment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - last update
over 1 year ago 29,418 pass - last update
over 1 year ago 29,420 pass - last update
over 1 year ago 29,420 pass 27:57 24:42 Running- last update
over 1 year ago 29,429 pass - last update
over 1 year ago 29,450 pass - last update
over 1 year ago 29,450 pass - π«π·France andypost
Fixing nit, dot at the end of links we trying to prevent to get full url, leaving RTBC
- last update
over 1 year ago 29,499 pass - last update
over 1 year ago 29,499 pass - last update
over 1 year ago 29,508 pass -
longwave β
committed c42d65e4 on 11.x
Issue #3219923 by andypost, Amber Himes Matz, jhodgdon: Add tests to...
-
longwave β
committed c42d65e4 on 11.x
- Status changed to Fixed
over 1 year ago 10:32am 22 June 2023 - π¬π§United Kingdom longwave UK
Committed and pushed c42d65e4a7 to 11.x (10.2.x). Thanks!
Automatically closed - issue fixed for 2 weeks with no activity.