diff options
Diffstat (limited to 'tests/Utils/MiscTest.php')
-rw-r--r-- | tests/Utils/MiscTest.php | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/tests/Utils/MiscTest.php b/tests/Utils/MiscTest.php index c6b03a2..01a2926 100644 --- a/tests/Utils/MiscTest.php +++ b/tests/Utils/MiscTest.php @@ -24,104 +24,104 @@ class MiscTest extends TestCase public function getAliasesProvider() { - return array( - array( + return [ + [ 'select * from (select 1) tbl', 'mydb', - array(), - ), - array( + [], + ], + [ 'select i.name as `n`,abcdef gh from qwerty i', 'mydb', - array( - 'mydb' => array( + [ + 'mydb' => [ 'alias' => null, - 'tables' => array( - 'qwerty' => array( + 'tables' => [ + 'qwerty' => [ 'alias' => 'i', - 'columns' => array( + 'columns' => [ 'name' => 'n', 'abcdef' => 'gh', - ), - ), - ), - ), - ), - ), - array( + ], + ], + ], + ], + ], + ], + [ 'select film_id id,title from film', 'sakila', - array( - 'sakila' => array( + [ + 'sakila' => [ 'alias' => null, - 'tables' => array( - 'film' => array( + 'tables' => [ + 'film' => [ 'alias' => null, - 'columns' => array( + 'columns' => [ 'film_id' => 'id', - ), - ), - ), - ), - ), - ), - array( + ], + ], + ], + ], + ], + ], + [ 'select `sakila`.`A`.`actor_id` as aid,`F`.`film_id` `fid`,' . 'last_update updated from `sakila`.actor A join `film_actor` as ' . '`F` on F.actor_id = A.`actor_id`', 'sakila', - array( - 'sakila' => array( + [ + 'sakila' => [ 'alias' => null, - 'tables' => array( - 'film_actor' => array( + 'tables' => [ + 'film_actor' => [ 'alias' => 'F', - 'columns' => array( + 'columns' => [ 'film_id' => 'fid', 'last_update' => 'updated', - ), - ), - 'actor' => array( + ], + ], + 'actor' => [ 'alias' => 'A', - 'columns' => array( + 'columns' => [ 'actor_id' => 'aid', 'last_update' => 'updated', - ), - ), - ), - ), - ), - ), - array( + ], + ], + ], + ], + ], + ], + [ 'SELECT film_id FROM (SELECT * FROM film) as f;', 'sakila', - array(), - ), - array( + [], + ], + [ '', null, - array(), - ), - array( + [], + ], + [ 'SELECT 1', null, - array(), - ), - array( + [], + ], + [ 'SELECT * FROM orders AS ord WHERE 1', 'db', - array( - 'db' => array( + [ + 'db' => [ 'alias' => null, - 'tables' => array( - 'orders' => array( + 'tables' => [ + 'orders' => [ 'alias' => 'ord', - 'columns' => array(), - ), - ), - ), - ), - ), - ); + 'columns' => [], + ], + ], + ], + ], + ], + ]; } } |