- 🇺🇸United States dww
Cool. I'm always interested in making Kernel tests easier, especially for multilingual stuff. 😉
A few docs nits, but one real point:
-
+++ b/core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTestSessionAndUrl.php @@ -0,0 +1,71 @@ + * Identify language from $_SESSION['language'] and set a language url prefix. ... + * Use case: in kernel tests we cannot rely on the url prefix to change ... + * be able to test links with language url prefixes.
s/url/URL/
-
+++ b/core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTestSessionAndUrl.php @@ -0,0 +1,71 @@ + * getLangcode() is taken from LanguageNegotiationUrl and simplified.
Can we add a @see pointing to exactly what class we're talking about here?
-
+++ b/core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTestSessionAndUrl.php @@ -0,0 +1,71 @@ + * processOutbound() is taken from LanguageNegotiationSession and simplified.
Ditto here.
-
+++ b/core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTestSessionAndUrl.php @@ -0,0 +1,71 @@ + * description = @Translation("Language from a session parameter. Outbound paths get prefix."),
These aren't complete sentences. 😉 How about:
"Gets the language from a session parameter. Outbound paths get a language prefix."
or something?
-
+++ b/core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTestSessionAndUrl.php @@ -0,0 +1,71 @@ +class LanguageNegotiationTestSessionAndUrl extends LanguageNegotiationMethodBase implements OutboundPathProcessorInterface {
I don't think we'd commit this change to core without anything using it. Can we modify/add some Kernel tests somewhere to show off why this change makes life better?
-
+++ b/core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTestSessionAndUrl.php @@ -0,0 +1,71 @@ + * The language negotiation method id.
s/id/ID/
NW mostly for point 5, but we might as well fix the others while we're at it...
Thanks!
-Derek -
- Status changed to Postponed: needs info
about 2 years ago 7:01pm 7 April 2023 - 🇺🇸United States smustgrave
Admittedly I rerolled this when I was getting started. But regards to point 5 I don't have an actual answer so moving to PNMI as this may actually not be needed? Happily to be wrong.
- 🇺🇸United States smustgrave
If no one can see the use for this in core, maybe free to close out.