aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functions/language_select_test.php
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2013-06-13 22:00:12 +0530
committerDhruv <dhruv.goel92@gmail.com>2013-06-13 22:00:12 +0530
commite8b535bf9beda58ea8f75071ed31934534849cb1 (patch)
tree36de3a5c8f46dda54d593593f71cb221cd9085ec /tests/functions/language_select_test.php
parentabd299b0a98be01499b31eb6901aca73d8c2b192 (diff)
parent6298cce464ea2035c107549dfed9bfcb2f985f9c (diff)
downloadforums-e8b535bf9beda58ea8f75071ed31934534849cb1.tar
forums-e8b535bf9beda58ea8f75071ed31934534849cb1.tar.gz
forums-e8b535bf9beda58ea8f75071ed31934534849cb1.tar.bz2
forums-e8b535bf9beda58ea8f75071ed31934534849cb1.tar.xz
forums-e8b535bf9beda58ea8f75071ed31934534849cb1.zip
Merge branch 'develop' into ticket/10820-develop
# By Joas Schilling (146) and others # Via Andreas Fischer (50) and others * develop: (356 commits) [ticket/11599] Copy the forums into a static array for later reuse [ticket/11602] Do not call localize_errors() if avatars are disabled [ticket/11601] Add protected method for database sync and call it [ticket/11601] Split post_setup_synchronisation logic from xml parsing [ticket/11550] Specify a valid path so it's clearer that it must be a path [ticket/11550] Move comments to correct function [ticket/11550] We use a different fixture set for extension_acp_test.php [ticket/11550] Fixtures should only be directories not files [ticket/11550] Use new functionality from the test case helpers [ticket/11550] Move functionality for copying/restoring to test case helpers [ticket/11550] Fix copying the fixtures in extension_permission_lang_test.php [ticket/11543] Add more users so #hidden <> #normal [ticket/11590] Close database connections when tearDown() is called [ticket/develop/11543] Use plurals in develop [ticket/11543] Use correct IP addresses and inject time for correct values [ticket/11543] Add unit tests for obtain_users_online_string() [ticket/11543] Add unit tests for obtain_users_online() with empty forum [ticket/11543] Add unit tests for obtain_users_online() [ticket/11543] Add unit tests for obtain_guest_count() [ticket/11481] Move prepended slash from calls into function ...
Diffstat (limited to 'tests/functions/language_select_test.php')
-rw-r--r--tests/functions/language_select_test.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/functions/language_select_test.php b/tests/functions/language_select_test.php
new file mode 100644
index 0000000000..3341e2a256
--- /dev/null
+++ b/tests/functions/language_select_test.php
@@ -0,0 +1,39 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_functions_language_select_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/language_select.xml');
+ }
+
+ static public function language_select_data()
+ {
+ return array(
+ array('', '<option value="cs">Čeština</option><option value="en">English</option>'),
+ array('en', '<option value="cs">Čeština</option><option value="en" selected="selected">English</option>'),
+ array('cs', '<option value="cs" selected="selected">Čeština</option><option value="en">English</option>'),
+ array('de', '<option value="cs">Čeština</option><option value="en">English</option>'),
+ );
+ }
+
+ /**
+ * @dataProvider language_select_data
+ */
+ public function test_language_select($default, $expected)
+ {
+ global $db;
+ $db = $this->new_dbal();
+
+ $this->assertEquals($expected, language_select($default));
+ }
+}