summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/unit/Prado.php29
-rw-r--r--tests/unit/Web/AllTests.php2
2 files changed, 29 insertions, 2 deletions
diff --git a/tests/unit/Prado.php b/tests/unit/Prado.php
index aebcfcd0..9e73c934 100644
--- a/tests/unit/Prado.php
+++ b/tests/unit/Prado.php
@@ -117,7 +117,34 @@ class Prado extends PradoBase {
} else {
throw new TInvalidDataValueException('prado_alias_invalid', $alias, $path);
}
- }*/
+ }*/
+
+
+ public static function getUserLanguages()
+ {
+ $languages=null;
+ // Recompute $languages each times it's called for unit tests
+ /*if($languages===null)
+ {*/
+ if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
+ $languages[0]='en';
+ else
+ {
+ $languages=array();
+ foreach(explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']) as $language)
+ {
+ $array=split(';q=',trim($language));
+ $languages[trim($array[0])]=isset($array[1])?(float)$array[1]:1.0;
+ }
+ arsort($languages);
+ $languages=array_keys($languages);
+ if(empty($languages))
+ $languages[0]='en';
+ }
+ /*}*/
+ return $languages;
+ }
+
}
?> \ No newline at end of file
diff --git a/tests/unit/Web/AllTests.php b/tests/unit/Web/AllTests.php
index b40b212f..0315c7eb 100644
--- a/tests/unit/Web/AllTests.php
+++ b/tests/unit/Web/AllTests.php
@@ -24,10 +24,10 @@ class Web_AllTests {
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('System.Web');
- $suite->addTestSuite('THttpRequestTest');
$suite->addTestSuite('TAssetManagerTest');
$suite->addTestSuite('THttpCookieCollectionTest');
$suite->addTestSuite('THttpCookieTest');
+ $suite->addTestSuite('THttpRequestTest');
$suite->addTestSuite('THttpResponseTest');
$suite->addTestSuite('THttpSessionTest');
$suite->addTestSuite('THttpUtilityTest');