When #1842718: Use new Transliteration functionality in core for machine names landed we still had the unicode string functions in procedural code. Now that #1938670: Convert unicode.inc to \Drupal\Component\Utility\Unicode has landed we can convert this test to PHPUnit.

Comments

alexpott’s picture

Status: Active » Needs review
Issue tags: +PHPUnit
StatusFileSize
new7.2 KB

And now for a patch...

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

Isn't this a lot more awesome with data providers?:)
Yay for the first phpunit test of system module!

Time: 0 seconds, Memory: 4.00Mb

OK (6 tests, 6 assertions)
dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mile23’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new2.08 KB

Updated for 100% code coverage.

dawehner’s picture

+++ b/core/modules/system/tests/Drupal/system/Tests/Transliteration/MachineNameControllerTest.phpundefined
@@ -37,8 +48,15 @@ public static function getInfo() {
+    // We need a transliteration object.
+    $trans = new PHPTransliteration();

Wouldn't it be better to mock this dependency instead? Then we can check that it is just called once. Additional your current approach kind of tests the functionality of the transliteration as well, and this is not needed.

ParisLiakos’s picture

Status: Needs review » Closed (fixed)

this is more or less hijacking an issue. please open a new one, thanks

jhedstrom’s picture