2011-12-15 16:18:52 +02:00
< ? php
/**
*
2014-05-27 20:18:06 +02:00
* This file is part of the phpBB Forum Software package .
*
* @ copyright ( c ) phpBB Limited < https :// www . phpbb . com >
* @ license GNU General Public License , version 2 ( GPL - 2.0 )
*
* For full copyright and license information , please see
* the docs / CREDITS . txt file .
2011-12-15 16:18:52 +02:00
*
*/
class phpbb_dbal_order_lower_test extends phpbb_database_test_case
{
public function getDataSet ()
{
return $this -> createXMLDataSet ( dirname ( __FILE__ ) . '/fixtures/styles.xml' );
}
2012-06-20 02:12:48 +02:00
public function test_order_lower ()
2011-12-15 16:18:52 +02:00
{
$db = $this -> new_dbal ();
2014-06-26 17:17:35 +02:00
if ( strpos ( $db -> get_sql_layer (), 'mysql' ) === 0 && version_compare ( $db -> sql_server_info ( true , false ), '5.6' , '>=' ))
2013-07-11 12:37:03 -04:00
{
$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' );
}
2011-12-15 16:18:52 +02:00
// http://tracker.phpbb.com/browse/PHPBB3-10507
// Test ORDER BY LOWER(style_name)
$db -> sql_return_on_error ( true );
$sql = 'SELECT * FROM phpbb_styles ORDER BY LOWER(style_name)' ;
$result = $db -> sql_query ( $sql );
$db -> sql_return_on_error ( false );
$this -> assertEquals ( array (
array (
'style_id' => 1 ,
'style_name' => 'prosilver' ,
2014-05-28 01:05:46 +02:00
'style_copyright' => '© phpBB Limited' ,
2011-12-15 16:18:52 +02:00
'style_active' => 1 ,
2012-02-18 02:01:35 +02:00
'style_path' => 'prosilver' ,
'bbcode_bitfield' => 'kNg=' ,
'style_parent_id' => 0 ,
'style_parent_tree' => '' ,
2011-12-15 16:18:52 +02:00
),
array (
'style_id' => 3 ,
'style_name' => 'Prosilver1' ,
2014-05-28 01:05:46 +02:00
'style_copyright' => '© phpBB Limited' ,
2011-12-15 16:18:52 +02:00
'style_active' => 0 ,
2012-02-18 02:01:35 +02:00
'style_path' => 'prosilver1' ,
'bbcode_bitfield' => 'kNg=' ,
'style_parent_id' => 1 ,
'style_parent_tree' => 'prosilver' ,
2011-12-15 16:18:52 +02:00
),
array (
'style_id' => 2 ,
'style_name' => 'prosilver2' ,
2014-05-28 01:05:46 +02:00
'style_copyright' => '© phpBB Limited' ,
2011-12-15 16:18:52 +02:00
'style_active' => 0 ,
2012-02-18 02:01:35 +02:00
'style_path' => 'prosilver2' ,
'bbcode_bitfield' => 'kNg=' ,
'style_parent_id' => 0 ,
'style_parent_tree' => '' ,
2011-12-15 16:18:52 +02:00
)
2013-07-11 12:37:03 -04:00
),
2011-12-15 16:18:52 +02:00
$db -> sql_fetchrowset ( $result )
);
}
}