mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
[ticket/10507] DBAL unit test
Unit test for ORDER BY LOWER(style_name) PHPBB3-10507
This commit is contained in:
62
tests/dbal/order_lower_test.php
Normal file
62
tests/dbal/order_lower_test.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package testing
|
||||
* @copyright (c) 2011 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
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_cross_join()
|
||||
{
|
||||
$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' => '© phpBB Group',
|
||||
'style_active' => 1,
|
||||
'template_id' => 1,
|
||||
'theme_id' => 1,
|
||||
'imageset_id' => 1
|
||||
),
|
||||
array(
|
||||
'style_id' => 3,
|
||||
'style_name' => 'Prosilver1',
|
||||
'style_copyright' => '© phpBB Group',
|
||||
'style_active' => 0,
|
||||
'template_id' => 3,
|
||||
'theme_id' => 3,
|
||||
'imageset_id' => 3
|
||||
),
|
||||
array(
|
||||
'style_id' => 2,
|
||||
'style_name' => 'prosilver2',
|
||||
'style_copyright' => '© phpBB Group',
|
||||
'style_active' => 0,
|
||||
'template_id' => 2,
|
||||
'theme_id' => 2,
|
||||
'imageset_id' => 2
|
||||
)
|
||||
),
|
||||
$db->sql_fetchrowset($result)
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user