From 3ffdec9ca1f6c9fbf994634ea2fc5fe93166fa4e Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 11 Nov 2017 22:39:41 +0100 Subject: [PATCH 1/4] Run testTestLocale on Travis --- tests/LocaleMiddlewareTest.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index 35c30e2..b156dd4 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -53,12 +53,11 @@ class LocaleMiddlewareTest extends TestCase */ public function testTestLocale() { - $this->markTestSkipped('For some reason, this test fails on Travis even if the fr_FR locale is installed.'); $locale = [ - 'language' => 'fr', - 'region' => 'FR', + 'language' => 'en', + 'region' => 'US', ]; - $this->assertEquals('fr_FR', $this->middleware->testLocale($locale)); + $this->assertEquals('en_US', $this->middleware->testLocale($locale)); } /** From 0027250de7b38bc373906b9e0ebe5117ffd59d73 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 11 Nov 2017 22:48:11 +0100 Subject: [PATCH 2/4] testTestLocale fails on Windows --- tests/LocaleMiddlewareTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index b156dd4..2b85619 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -50,6 +50,7 @@ class LocaleMiddlewareTest extends TestCase * Test the testLocale() function. * * @return void + * @requires OS Linux */ public function testTestLocale() { From c07322e1600c72e3ee327faaf95a0348b7fb3378 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 11 Nov 2017 22:50:54 +0100 Subject: [PATCH 3/4] Remove buggy test (the video is not available anymore) --- tests/FrontControllerTest.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index 40e8d2e..4962c7f 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -260,17 +260,6 @@ class FrontControllerTest extends TestCase $this->assertRequestIsOk('video', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU']); } - /** - * Test the video() function with a video that does not have a title. - * - * @return void - */ - public function testVideoWithoutTitle() - { - $this->markTestSkipped('This URL triggers a curl SSL error on Travis'); - $this->assertRequestIsOk('video', ['url' => 'http://html5demos.com/video']); - } - /** * Test the video() function with audio conversion. * From 1b5e99403f78f66163f1a5707d686ca79304f90b Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 11 Nov 2017 23:00:53 +0100 Subject: [PATCH 4/4] Basic testEnv test --- tests/LocaleManagerTest.php | 11 +++++++++++ tests/LocaleMiddlewareTest.php | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/LocaleManagerTest.php b/tests/LocaleManagerTest.php index 2808362..0e88239 100644 --- a/tests/LocaleManagerTest.php +++ b/tests/LocaleManagerTest.php @@ -86,4 +86,15 @@ class LocaleManagerTest extends TestCase $this->localeManager->unsetLocale(); $this->assertNull($this->localeManager->getLocale()); } + + /** + * Test that the environment is correctly set up. + * + * @return void + */ + public function testEnv() + { + $this->localeManager->setLocale(new Locale('foo_BAR')); + $this->assertEquals('foo_BAR', getenv('LANG')); + } } diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index 2b85619..0db9f9f 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -131,14 +131,4 @@ class LocaleMiddlewareTest extends TestCase [$this, 'assertNoHeader'] ); } - - /** - * Test that the environment is correctly set up. - * - * @return void - */ - public function testEnv() - { - $this->markTestIncomplete('We need to find a way to reliably test LC_ALL and LANG values'); - } }