Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
12 / 12 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| phpbb_dbal_schema_test | |
100.00% |
12 / 12 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| getDataSet | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| test_config_value_multibyte | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * |
| 4 | * This file is part of the phpBB Forum Software package. |
| 5 | * |
| 6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
| 7 | * @license GNU General Public License, version 2 (GPL-2.0) |
| 8 | * |
| 9 | * For full copyright and license information, please see |
| 10 | * the docs/CREDITS.txt file. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | class phpbb_dbal_schema_test extends phpbb_database_test_case |
| 15 | { |
| 16 | public function getDataSet() |
| 17 | { |
| 18 | return $this->createXMLDataSet(__DIR__.'/fixtures/config.xml'); |
| 19 | } |
| 20 | |
| 21 | public function test_config_value_multibyte() |
| 22 | { |
| 23 | $db = $this->new_dbal(); |
| 24 | |
| 25 | $value = str_repeat("\xC3\x84", 255); |
| 26 | $sql = "INSERT INTO phpbb_config |
| 27 | (config_name, config_value) |
| 28 | VALUES ('name', '$value')"; |
| 29 | $db->sql_query($sql); |
| 30 | |
| 31 | $sql = "SELECT config_value |
| 32 | FROM phpbb_config |
| 33 | WHERE config_name = 'name'"; |
| 34 | $result = $db->sql_query_limit($sql, 1); |
| 35 | $row = $db->sql_fetchrow($result); |
| 36 | $db->sql_freeresult($result); |
| 37 | |
| 38 | $this->assertEquals($value, $row['config_value']); |
| 39 | } |
| 40 | } |