From 788e6e93b1dc12e7d663d80f66a67dd22e6e7b3d Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 31 May 2017 00:56:53 +0200 Subject: [PATCH] Fake LocaleManager session in test --- tests/LocaleManagerTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/LocaleManagerTest.php b/tests/LocaleManagerTest.php index 073b9a5..693346f 100644 --- a/tests/LocaleManagerTest.php +++ b/tests/LocaleManagerTest.php @@ -28,6 +28,18 @@ class LocaleManagerTest extends \PHPUnit_Framework_TestCase $this->localeManager = new LocaleManager(); } + /** + * Test the getSupportedLocales function. + * + * @return void + */ + public function testConstructorWithCookies() + { + $_SESSION['Alltube\LocaleManager']['locale'] = 'foo_BAR'; + $localeManager = new LocaleManager([]); + $this->assertEquals('foo_BAR', (string) $localeManager->getLocale()); + } + /** * Test the getSupportedLocales function. *