1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-18 22:58:10 +01:00

Merge branch 'develop-olympus' into develop

* develop-olympus:
  [ticket/11542] Add non-existing default value for language select
  [ticket/11542] Add lang_english_name to fixture
  [ticket/11542] Add unit tests for language_select()
This commit is contained in:
Andreas Fischer 2013-05-17 00:38:09 +02:00
commit 4a1eaab341
2 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dataset>
<table name="phpbb_lang">
<column>lang_id</column>
<column>lang_iso</column>
<column>lang_local_name</column>
<column>lang_english_name</column>
<row>
<value>1</value>
<value>en</value>
<value>English</value>
<value>English</value>
</row>
<row>
<value>2</value>
<value>de</value>
<value>Deutsch</value>
<value>German</value>
</row>
</table>
</dataset>

View File

@ -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="en">English</option><option value="de">Deutsch</option>'),
array('en', '<option value="en" selected="selected">English</option><option value="de">Deutsch</option>'),
array('de', '<option value="en">English</option><option value="de" selected="selected">Deutsch</option>'),
array('cs', '<option value="en">English</option><option value="de">Deutsch</option>'),
);
}
/**
* @dataProvider language_select_data
*/
public function test_language_select($default, $expected)
{
global $db;
$db = $this->new_dbal();
$this->assertEquals($expected, language_select($default));
}
}