Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
97.62% |
41 / 42 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| phpbb_dbal_order_lower_test | |
97.62% |
41 / 42 |
|
50.00% |
1 / 2 |
4 | |
0.00% |
0 / 1 |
| getDataSet | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| test_order_lower | |
97.56% |
40 / 41 |
|
0.00% |
0 / 1 |
3 | |||
| 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_order_lower_test extends phpbb_database_test_case |
| 15 | { |
| 16 | public function getDataSet() |
| 17 | { |
| 18 | return $this->createXMLDataSet(__DIR__.'/fixtures/styles.xml'); |
| 19 | } |
| 20 | |
| 21 | public function test_order_lower() |
| 22 | { |
| 23 | $db = $this->new_dbal(); |
| 24 | |
| 25 | if (strpos($db->get_sql_layer(), 'mysql') === 0 && version_compare($db->sql_server_info(true, false), '5.6', '>=')) |
| 26 | { |
| 27 | $this->markTestSkipped('MySQL 5.6 fails to order things correctly. See also: http://tracker.phpbb.com/browse/PHPBB3-11571 http://bugs.mysql.com/bug.php?id=69005'); |
| 28 | } |
| 29 | |
| 30 | // http://tracker.phpbb.com/browse/PHPBB3-10507 |
| 31 | // Test ORDER BY LOWER(style_name) |
| 32 | $db->sql_return_on_error(true); |
| 33 | |
| 34 | $sql = 'SELECT * FROM phpbb_styles ORDER BY LOWER(style_name)'; |
| 35 | $result = $db->sql_query($sql); |
| 36 | |
| 37 | $db->sql_return_on_error(false); |
| 38 | |
| 39 | $this->assertEquals(array( |
| 40 | array( |
| 41 | 'style_id' => 1, |
| 42 | 'style_name' => 'prosilver', |
| 43 | 'style_copyright' => '© phpBB Limited', |
| 44 | 'style_active' => 1, |
| 45 | 'style_path' => 'prosilver', |
| 46 | 'bbcode_bitfield' => 'kNg=', |
| 47 | 'style_parent_id' => 0, |
| 48 | 'style_parent_tree' => '', |
| 49 | ), |
| 50 | array( |
| 51 | 'style_id' => 3, |
| 52 | 'style_name' => 'Prosilver1', |
| 53 | 'style_copyright' => '© phpBB Limited', |
| 54 | 'style_active' => 0, |
| 55 | 'style_path' => 'prosilver1', |
| 56 | 'bbcode_bitfield' => 'kNg=', |
| 57 | 'style_parent_id' => 1, |
| 58 | 'style_parent_tree' => 'prosilver', |
| 59 | ), |
| 60 | array( |
| 61 | 'style_id' => 2, |
| 62 | 'style_name' => 'prosilver2', |
| 63 | 'style_copyright' => '© phpBB Limited', |
| 64 | 'style_active' => 0, |
| 65 | 'style_path' => 'prosilver2', |
| 66 | 'bbcode_bitfield' => 'kNg=', |
| 67 | 'style_parent_id' => 0, |
| 68 | 'style_parent_tree' => '', |
| 69 | ) |
| 70 | ), |
| 71 | $db->sql_fetchrowset($result) |
| 72 | ); |
| 73 | } |
| 74 | } |