Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
It would be cool to have a @see (the class we test) and a @group Drupal
+++ b/core/tests/Drupal/Tests/Component/Utility/CSSTest.php
@@ -0,0 +1,66 @@
+ public static function getInfo() {
Let's introduce an empty line in here.
+++ b/core/tests/Drupal/Tests/Component/Utility/CSSTest.php
@@ -0,0 +1,66 @@
+ * Tests that drupal_clean_css_identifier() cleans the identifier properly.
+ *
Should we just point to the CSS::cleanIdentifier method?
+++ b/core/tests/Drupal/Tests/Component/Utility/CSSTest.php
@@ -0,0 +1,66 @@
+ public function provider() {
We kind of have the "standard" in core to use providerTestNameofTheTest, so here providerTestDrupalCleanCSSIdenfier ... just mentioning as there are some small other points.
Comments
Comment #1
nick_schuch commentedHere is the patch. I also need to write some tests.
Comment #2
nick_schuch commentedHere we go. Migrated to use UnitTestBase. Also implemented in Tour module to prove this change is working.
Comment #3
larowlannitpick: 80 chars
Other than that looks good to go to me.
Comment #4
nick_schuch commentedHere we go. Thanks larowlan! :)
Comment #5
dawehnerLet's document the variable types as well.
It would be cool to have a @see (the class we test) and a @group Drupal
Let's introduce an empty line in here.
Should we just point to the CSS::cleanIdentifier method?
We kind of have the "standard" in core to use providerTestNameofTheTest, so here providerTestDrupalCleanCSSIdenfier ... just mentioning as there are some small other points.
Comment #6
ParisLiakos commentedshould be
Css and CssTest
Comment #7
msmithcti commentedThis should cover all points in #5 and #6 as well as a much needed reroll.
Comment #9
msmithcti commented#7: drupal_clean_css_identifier-to-component-2082103-7.patch queued for re-testing.
Comment #11
tim.plunkettSo it turns out I completely duplicated the work of this issue.
I was working on #2121713: Move drupal_html_id() and drupal_html_class() to Drupal\Component\Utility, which forced me to do drupal_clean_css_identifier as well...
Want to merge them?
Comment #12
nick_schuch commentedSounds good to me!
Comment #13
tim.plunkettUpdated the other issue to ensure you get commit credit, closing.