From dfc2c3353d95ffd095ef02f1060ea7ebe99a18d2 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Tue, 19 Sep 2017 18:36:41 +0200 Subject: [PATCH 1/2] Travis: switch to Ubuntu Trusty build environment Relates to https://github.com/shaarli/Shaarli/issues/970 Relates to https://github.com/shaarli/Shaarli/pull/912 See: - https://docs.travis-ci.com/user/reference/trusty/ - https://blog.travis-ci.com/2017-07-11-trusty-as-default-linux-is-coming Added: - print available locales before running tests Removed: - do not install extra language packs Signed-off-by: VirtualTam --- .travis.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 26535ad..7240138 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,6 @@ sudo: false -dist: precise +dist: trusty language: php -addons: - apt: - packages: - - locales - - language-pack-de - - language-pack-fr cache: directories: - $HOME/.composer/cache @@ -19,6 +13,7 @@ install: - composer self-update - composer install --prefer-dist script: + - locale -a - make clean - make check_permissions - make all_tests From b5c33d702ac973e7bc1401e484c6b8799eea1e91 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Tue, 19 Sep 2017 19:17:16 +0200 Subject: [PATCH 2/2] Tests: update localization tests Rely on `mag_IN` (Magahi - INDIA) being unavailable when running localization test suites, instead of `pt_BR` that is now available from Travis build images. Signed-off-by: VirtualTam --- .travis.yml | 2 +- tests/languages/de/UtilsDeTest.php | 12 ++++++------ tests/languages/en/UtilsEnTest.php | 12 ++++++------ tests/languages/fr/UtilsFrTest.php | 12 ++++++------ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7240138..b6b9bdd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,8 @@ php: install: - composer self-update - composer install --prefer-dist -script: - locale -a +script: - make clean - make check_permissions - make all_tests diff --git a/tests/languages/de/UtilsDeTest.php b/tests/languages/de/UtilsDeTest.php index 6c9c9ad..4569c92 100644 --- a/tests/languages/de/UtilsDeTest.php +++ b/tests/languages/de/UtilsDeTest.php @@ -81,12 +81,12 @@ class UtilsDeTest extends UtilsTest } /** - * Test autoLocale with multiples value, the second one is valid + * Test autoLocale with multiples value, the second one is available */ - public function testAutoLocaleMultipleSecondValid() + public function testAutoLocaleMultipleSecondAvailable() { $current = setlocale(LC_ALL, 0); - $header = 'pt_BR,fr-fr'; + $header = 'mag_IN,fr-fr'; autoLocale($header); $this->assertEquals('fr_FR.utf8', setlocale(LC_ALL, 0)); @@ -106,12 +106,12 @@ class UtilsDeTest extends UtilsTest } /** - * Test autoLocale with an invalid value: defaults to en_US. + * Test autoLocale with an unavailable value: defaults to en_US. */ - public function testAutoLocaleInvalid() + public function testAutoLocaleUnavailable() { $current = setlocale(LC_ALL, 0); - autoLocale('pt_BR'); + autoLocale('mag_IN'); $this->assertEquals('en_US.utf8', setlocale(LC_ALL, 0)); setlocale(LC_ALL, $current); diff --git a/tests/languages/en/UtilsEnTest.php b/tests/languages/en/UtilsEnTest.php index d8680b2..a74063a 100644 --- a/tests/languages/en/UtilsEnTest.php +++ b/tests/languages/en/UtilsEnTest.php @@ -81,12 +81,12 @@ class UtilsEnTest extends UtilsTest } /** - * Test autoLocale with multiples value, the second one is valid + * Test autoLocale with multiples value, the second one is available */ - public function testAutoLocaleMultipleSecondValid() + public function testAutoLocaleMultipleSecondAvailable() { $current = setlocale(LC_ALL, 0); - $header = 'pt_BR,fr-fr'; + $header = 'mag_IN,fr-fr'; autoLocale($header); $this->assertEquals('fr_FR.utf8', setlocale(LC_ALL, 0)); @@ -106,12 +106,12 @@ class UtilsEnTest extends UtilsTest } /** - * Test autoLocale with an invalid value: defaults to en_US. + * Test autoLocale with an unavailable value: defaults to en_US. */ - public function testAutoLocaleInvalid() + public function testAutoLocaleUnavailable() { $current = setlocale(LC_ALL, 0); - autoLocale('pt_BR'); + autoLocale('mag_IN'); $this->assertEquals('en_US.utf8', setlocale(LC_ALL, 0)); setlocale(LC_ALL, $current); diff --git a/tests/languages/fr/UtilsFrTest.php b/tests/languages/fr/UtilsFrTest.php index 0d50a87..3dbb126 100644 --- a/tests/languages/fr/UtilsFrTest.php +++ b/tests/languages/fr/UtilsFrTest.php @@ -81,12 +81,12 @@ class UtilsFrTest extends UtilsTest } /** - * Test autoLocale with multiples value, the second one is valid + * Test autoLocale with multiples value, the second one is available */ - public function testAutoLocaleMultipleSecondValid() + public function testAutoLocaleMultipleSecondAvailable() { $current = setlocale(LC_ALL, 0); - $header = 'pt_BR,de-de'; + $header = 'mag_IN,de-de'; autoLocale($header); $this->assertEquals('de_DE.utf8', setlocale(LC_ALL, 0)); @@ -106,12 +106,12 @@ class UtilsFrTest extends UtilsTest } /** - * Test autoLocale with an invalid value: defaults to en_US. + * Test autoLocale with an unavailable value: defaults to en_US. */ - public function testAutoLocaleInvalid() + public function testAutoLocaleUnavailable() { $current = setlocale(LC_ALL, 0); - autoLocale('pt_BR'); + autoLocale('mag_IN'); $this->assertEquals('en_US.utf8', setlocale(LC_ALL, 0)); setlocale(LC_ALL, $current);