Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/classes/PMA_DisplayResults_test.php')
-rw-r--r--test/classes/PMA_DisplayResults_test.php84
1 files changed, 20 insertions, 64 deletions
diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php
index 9846c986dd..9c69a6b004 100644
--- a/test/classes/PMA_DisplayResults_test.php
+++ b/test/classes/PMA_DisplayResults_test.php
@@ -94,15 +94,18 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
*/
public function testisSelect()
{
- $analyzed_sql = array(array());
- $analyzed_sql[0]['select_expr'] = array();
- $analyzed_sql[0]['queryflags']['select_from'] = 'pma';
- $analyzed_sql[0]['table_ref'] = array('table_ref');
-
+ $parser = new \SqlParser\Parser('SELECT * FROM pma');
$this->assertTrue(
$this->_callPrivateFunction(
'_isSelect',
- array($analyzed_sql)
+ array(
+ array(
+ 'statement' => $parser->statements[0],
+ 'queryflags' => array(
+ 'select_from' => true,
+ ),
+ ),
+ )
)
);
}
@@ -350,57 +353,6 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
}
/**
- * Data provider for testGetSortParams
- *
- * @return array parameters and output
- */
- public function dataProviderForGetSortParams()
- {
- return array(
- array('', array(array(''), array(''), array(''))),
- array(
- '`a_sales`.`customer_id` ASC',
- array(
- array('`a_sales`.`customer_id` ASC'),
- array('`a_sales`.`customer_id`'),
- array('ASC')
- )
- ),
- array(
- '`a_sales`.`customer_id` ASC, `b_sales`.`customer_id` DESC',
- array(
- array(
- '`a_sales`.`customer_id` ASC',
- '`b_sales`.`customer_id` DESC'
- ),
- array('`a_sales`.`customer_id`', '`b_sales`.`customer_id`'),
- array('ASC', 'DESC')
- )
- ),
- );
- }
-
- /**
- * Test for _getSortParams
- *
- * @param string $order_by_clause the order by clause of the sql query
- * @param string $output output of _getSortParams
- *
- * @return void
- *
- * @dataProvider dataProviderForGetSortParams
- */
- public function testGetSortParams($order_by_clause, $output)
- {
- $this->assertEquals(
- $output,
- $this->_callPrivateFunction(
- '_getSortParams', array($order_by_clause)
- )
- );
- }
-
- /**
* Data provider for testGetCheckboxForMultiRowSubmissions
*
* @return array parameters and output
@@ -1290,18 +1242,22 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
{
return array(
array(
- array(),
+ array(
+ 'analyzed_sql' => array(),
+ ),
array()
),
array(
array(
- 0 => array(
- 'where_clause_identifiers' => array(
- 0 => '`id`',
- 1 => '`id`',
- 2 => '`db_name`'
+ 'analyzed_sql' => array(
+ 0 => array(
+ 'where_clause_identifiers' => array(
+ 0 => '`id`',
+ 1 => '`id`',
+ 2 => '`db_name`'
+ )
)
- )
+ ),
),
array(
'`id`' => 'true',