ZF2-43: Zend\Translator tests fail because of unescaped regex
Description
This looks like a regression that was introduced in commit 8e34a0ea0f33ca, now in master branch.
It seems that the pattern used to create the RegexIterator is not being escaped properly, so for example if $ignore is '/.' (which is probably the most common value), the regex will be '//./u' which is invalid.
This breaks the tests, and I get for example:
37) ZendTest\Translator\TranslatorTest::testSettingLogPriorityForLog
InvalidArgumentException: RecursiveRegexIterator::__construct(): Unknown modifier '.'
/Users/shahar/Code/zf2/library/Zend/Translator/Adapter.php:271
/Users/shahar/Code/zf2/library/Zend/Translator/Adapter.php:179
/Users/shahar/Code/zf2/library/Zend/Translator/Adapter/Csv.php:70
/Users/shahar/Code/zf2/library/Zend/Translator/Translator.php:145
/Users/shahar/Code/zf2/library/Zend/Translator/Translator.php:94
/Users/shahar/Code/zf2/tests/Zend/Translator/TranslatorTest.php:859
Comments
Posted by Shahar Evron (shahar) on 2011-07-28T07:35:39.000+0000
This is a naive attempt to fix the problem that works for me. Hopefully it is good enough.
Posted by Thomas Weidner (thomas) on 2011-07-30T12:06:50.000+0000
This patch breaks 36 tests in my environment. It seems to be a Win-nix problem.
Posted by Thomas Weidner (thomas) on 2011-08-30T19:26:52.000+0000
Fixed with GH-358