Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Dec 2013 at 16:32 UTC
Updated:
29 Jul 2014 at 23:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerIt works fine for me.
Maybe you could paste the full failure.
Comment #2
xanoThe three full failures.
Comment #3
mile23@Xano: I'd wager you don't have iconv, mbstring, or recode installed on your PHP.
Unicode::convertToUtf8() returns FALSE in that case, and the unit tests don't account for that.
Yay! You found the edge case! :-)
This needs to happen: http://phpunit.de/manual/3.7/en/incomplete-and-skipped-tests.html#incomp...
Comment #4
mile23A patch to solve the error, but not the testing problem.
This only checks if the conversion functions exist or not, and checks for FALSE if they don't.
The method we're checking here is this one: http://drupalcode.org/project/drupal.git/blob/HEAD:/core/lib/Drupal/Comp...
Comment #5
xanoI wonder if this is a faulty test, or a missing requirement for Drupal core.
Comment #6
mile23It's both. :-) In this case, however, Drupal handles the case where the requirements aren't met, so we have to test that outcome.
That's why I just patched it so it would pass, with a @todo. It leads to an interesting question: Should unit tests fail if the requirements aren't met?
Comment #7
xanoWhat about this approach? We test
Unicode::check()and make sure that passes before we test anything that depends on it.Comment #8
xanoThe assert in the previous patch was faulty. This actually works on my system that (apparently) doesn't have any PHP Unicode extension.
Comment #9
mile23Well, that's kind of the question: Am I right in my assumptions? :-)
Make a phpinfo() page and find out if you have mbstring, iconv, and/or recode.
You can also do this as
php -iat the command line and look to see if they're in your system.Comment #11
xano8: drupal_2149827_8.patch queued for re-testing.
I do have mbstring locally, and so do the testbots, so this shouldn't have failed at all.
Comment #12
xanoErr, never mind that last patch. The patch from #7 is good.
Comment #14
xanomb_convert_encoding()saysWindows-1250is an illegal character encoding.Edit:
mb_list_encodings()only returns Windows-1251, Windows-1252, and Windows-1254 as Windows encodings.Comment #15
xanoThis works locally. However, there is no way of knowing which encodings
iconv()supports as that depends on its internal library, and I haven't been able to find out which encodings are supported byrecode_string().Comment #16
xanoComment #17
xanoComment #18
mile23I'm Mile23, and I approve this patch.
Comment #19
catchCommitted/pushed to 8.x, thanks!