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:
commit
4a1eaab341
21
tests/functions/fixtures/language_select.xml
Normal file
21
tests/functions/fixtures/language_select.xml
Normal 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>
|
39
tests/functions/language_select_test.php
Normal file
39
tests/functions/language_select_test.php
Normal 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));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user