diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7377001 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,79 @@ +language: php + +matrix: + include: + - php: 7.0 + env: + - PHP_SRC_VERSION=7.0.26 + - php: 7.1 + env: + - ENABLE_XDEBUG=true + - PHP_SRC_VERSION=7.1.11 + - php: 7.2 + env: + - PHP_SRC_VERSION=7.2.0 + - php: nightly + env: + - PHP_SRC_VERSION=7.2.0 + allow_failures: + - php: nightly + - php: 7.2 + fast_finish: true + +os: + - linux + +notifications: + irc: "chat.freenode.net#hoaproject" + +sudo: false + +env: + global: + - secure: "AAAAB3NzaC1yc2EAAAADAQABAAAAgQCecwgg2D4ihDiYD9Af7hU7oroL108l1BJaxZ9N0GXmoaJj3JOHKjXgUjizhma5nftXRBJOcIhT4GsLAnFeNKgJv/97cAvm7miHeTLYPOiOpkrf/Zl7UIQ0MKSX91YKdneAGRDFaY0Tq5B9KjK68vu0Cof35h+cf59Ld3hTzrGPZw==" + +cache: + directories: + - vendor/ + - /home/travis/php-src + +before_script: + - export PATH="$PATH:$HOME/.composer/vendor/bin" + - if [[ ! $ENABLE_XDEBUG ]]; then + phpenv config-rm xdebug.ini || echo "ext-xdebug is not available, cannot remove it."; + fi + - if [[ `ls /home/travis/php-src | wc -l` -eq 0 ]]; then + curl -Ss "http://ie1.php.net/distributions/php-${PHP_SRC_VERSION}.tar.bz2" -o /home/travis/php-src.tar.bz2; + cd /home/travis/; + mkdir php-src; + tar xjf php-src.tar.bz2 -C php-src --strip-components=1; + cd php-src/ext/intl; + phpize; + ./configure; + make; + fi + - cd /home/travis/php-src/ext/intl && make install + - cd $TRAVIS_BUILD_DIR + - locale + +script: + - composer install + - vendor/bin/hoa test:run + - if [[ $ENABLE_DEVTOOLS ]]; then + composer global require friendsofphp/php-cs-fixer; + vendor/bin/hoa devtools:cs --diff --dry-run .; + fi + +addons: + apt: + packages: + - libicu-dev + - unicode + - unicode-data + - ttf-ancient-fonts + - xfonts-efont-unicode + - unifont + - ttf-unifont + - locales + - language-pack-en + - language-pack-fr diff --git a/README.md b/README.md index c934a74..1c3e10f 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ ---

- Build status - Code coverage + Build status + Code coverage Packagist License

diff --git a/Source/Ustring.php b/Source/Ustring.php index dcf0f00..8d82c8b 100644 --- a/Source/Ustring.php +++ b/Source/Ustring.php @@ -423,7 +423,7 @@ function (array $matches) { ); } - $string = static::transcode($string, 'UTF-8', 'ASCII//IGNORE//TRANSLIT'); + $string = static::transcode($string, 'UTF-8', 'ASCII//TRANSLIT'); $this->_string = preg_replace('#(?:[\'"`^](\w))#u', '\1', $string); return $this; @@ -431,7 +431,7 @@ function (array $matches) { $string = \Normalizer::normalize($string, \Normalizer::NFKD); $string = preg_replace('#\p{Mn}+#u', '', $string); - $this->_string = static::transcode($string, 'UTF-8', 'ASCII//IGNORE//TRANSLIT'); + $this->_string = static::transcode($string, 'UTF-8', 'ASCII//TRANSLIT'); return $this; } diff --git a/Test/Unit/Ustring.php b/Test/Unit/Ustring.php index a49ce6e..c099662 100644 --- a/Test/Unit/Ustring.php +++ b/Test/Unit/Ustring.php @@ -192,8 +192,8 @@ public function case_collator(): void ) ->when($result = $collator->getLocale(\Locale::VALID_LOCALE)) ->then - ->string($result) - ->isEqualTo('fr'); + ->boolean(in_array($result, ['fr', 'fr_FR'])) + ->isTrue(); } public function case_safe_unsafe_pattern(): void