1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 20:13:22 +01:00
php-phpbb/tests/dbal/order_lower_test.php
2012-06-20 02:12:48 +02:00

66 lines
1.6 KiB
PHP

<?php
/**
*
* @package testing
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
class phpbb_dbal_order_lower_test extends phpbb_database_test_case
{
public function getDataSet()
{
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/styles.xml');
}
public function test_order_lower()
{
$db = $this->new_dbal();
// 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',
'style_copyright' => '&copy; phpBB Group',
'style_active' => 1,
'style_path' => 'prosilver',
'bbcode_bitfield' => 'kNg=',
'style_parent_id' => 0,
'style_parent_tree' => '',
),
array(
'style_id' => 3,
'style_name' => 'Prosilver1',
'style_copyright' => '&copy; phpBB Group',
'style_active' => 0,
'style_path' => 'prosilver1',
'bbcode_bitfield' => 'kNg=',
'style_parent_id' => 1,
'style_parent_tree' => 'prosilver',
),
array(
'style_id' => 2,
'style_name' => 'prosilver2',
'style_copyright' => '&copy; phpBB Group',
'style_active' => 0,
'style_path' => 'prosilver2',
'bbcode_bitfield' => 'kNg=',
'style_parent_id' => 0,
'style_parent_tree' => '',
)
),
$db->sql_fetchrowset($result)
);
}
}