diff options
author | Maurício Meneghini Fauth <mauriciofauth@gmail.com> | 2019-01-08 21:32:02 -0200 |
---|---|---|
committer | Maurício Meneghini Fauth <mauriciofauth@gmail.com> | 2019-01-16 17:21:25 -0200 |
commit | 86c5baebda24c1721fb6881df8671a3c7df60e8b (patch) | |
tree | 0a76d58ea229d1008e169b1c5b25ce90dde91808 /tests/Utils/TableTest.php | |
parent | 28427543566b6dd32fe44db704ea41368ba55c0e (diff) | |
download | sql-parser-86c5baebda24c1721fb6881df8671a3c7df60e8b.zip sql-parser-86c5baebda24c1721fb6881df8671a3c7df60e8b.tar.gz sql-parser-86c5baebda24c1721fb6881df8671a3c7df60e8b.tar.bz2 |
Apply phpmyadmin/coding-standard
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Diffstat (limited to 'tests/Utils/TableTest.php')
-rw-r--r-- | tests/Utils/TableTest.php | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/tests/Utils/TableTest.php b/tests/Utils/TableTest.php index ef21137..fe68100 100644 --- a/tests/Utils/TableTest.php +++ b/tests/Utils/TableTest.php @@ -21,12 +21,12 @@ class TableTest extends TestCase public function getForeignKeysProvider() { - return array( - array( + return [ + [ 'CREATE USER test', - array(), - ), - array( + [], + ], + [ 'CREATE TABLE `payment` ( `payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `customer_id` smallint(5) unsigned NOT NULL, @@ -43,35 +43,35 @@ class TableTest extends TestCase CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8', - array( - array( + [ + [ 'constraint' => 'fk_payment_customer', - 'index_list' => array('customer_id'), + 'index_list' => ['customer_id'], 'ref_db_name' => null, 'ref_table_name' => 'customer', - 'ref_index_list' => array('customer_id'), + 'ref_index_list' => ['customer_id'], 'on_update' => 'CASCADE', - ), - array( + ], + [ 'constraint' => 'fk_payment_rental', - 'index_list' => array('rental_id'), + 'index_list' => ['rental_id'], 'ref_db_name' => null, 'ref_table_name' => 'rental', - 'ref_index_list' => array('rental_id'), + 'ref_index_list' => ['rental_id'], 'on_delete' => 'SET_NULL', 'on_update' => 'CASCADE', - ), - array( + ], + [ 'constraint' => 'fk_payment_staff', - 'index_list' => array('staff_id'), + 'index_list' => ['staff_id'], 'ref_db_name' => null, 'ref_table_name' => 'staff', - 'ref_index_list' => array('staff_id'), + 'ref_index_list' => ['staff_id'], 'on_update' => 'CASCADE', - ), - ), - ), - array( + ], + ], + ], + [ 'CREATE TABLE `actor` ( `actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `first_name` varchar(45) NOT NULL, @@ -80,9 +80,9 @@ class TableTest extends TestCase PRIMARY KEY (`actor_id`), KEY `idx_actor_last_name` (`last_name`) ) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8', - array(), - ), - array( + [], + ], + [ 'CREATE TABLE `address` ( `address_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `address` varchar(50) NOT NULL, @@ -96,18 +96,18 @@ class TableTest extends TestCase KEY `idx_fk_city_id` (`city_id`), CONSTRAINT `fk_address_city` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=606 DEFAULT CHARSET=utf8', - array( - array( + [ + [ 'constraint' => 'fk_address_city', - 'index_list' => array('city_id'), + 'index_list' => ['city_id'], 'ref_db_name' => null, 'ref_table_name' => 'city', - 'ref_index_list' => array('city_id'), + 'ref_index_list' => ['city_id'], 'on_update' => 'CASCADE', - ), - ), - ), - ); + ], + ], + ], + ]; } /** @@ -123,12 +123,12 @@ class TableTest extends TestCase public function getFieldsProvider() { - return array( - array( + return [ + [ 'CREATE USER test', - array(), - ), - array( + [], + ], + [ 'CREATE TABLE `address` ( `address_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `address` varchar(50) NOT NULL, @@ -142,76 +142,76 @@ class TableTest extends TestCase KEY `idx_fk_city_id` (`city_id`), CONSTRAINT `fk_address_city` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=606 DEFAULT CHARSET=utf8', - array( - 'address_id' => array( + [ + 'address_id' => [ 'type' => 'SMALLINT', 'timestamp_not_null' => false, - ), - 'address' => array( + ], + 'address' => [ 'type' => 'VARCHAR', 'timestamp_not_null' => false, - ), - 'address2' => array( + ], + 'address2' => [ 'type' => 'VARCHAR', 'timestamp_not_null' => false, 'default_value' => 'NULL', - ), - 'district' => array( + ], + 'district' => [ 'type' => 'VARCHAR', 'timestamp_not_null' => false, - ), - 'city_id' => array( + ], + 'city_id' => [ 'type' => 'SMALLINT', 'timestamp_not_null' => false, - ), - 'postal_code' => array( + ], + 'postal_code' => [ 'type' => 'VARCHAR', 'timestamp_not_null' => false, 'default_value' => 'NULL', - ), - 'phone' => array( + ], + 'phone' => [ 'type' => 'VARCHAR', 'timestamp_not_null' => false, - ), - 'last_update' => array( + ], + 'last_update' => [ 'type' => 'TIMESTAMP', 'timestamp_not_null' => true, 'default_value' => 'CURRENT_TIMESTAMP', 'default_current_timestamp' => true, 'on_update_current_timestamp' => true, - ), - ), - ), - array( + ], + ], + ], + [ 'CREATE TABLE table1 ( a INT NOT NULL, b VARCHAR(32), c INT AS (a mod 10) VIRTUAL, d VARCHAR(5) AS (left(b,5)) PERSISTENT )', - array( - 'a' => array( + [ + 'a' => [ 'type' => 'INT', 'timestamp_not_null' => false, - ), - 'b' => array( + ], + 'b' => [ 'type' => 'VARCHAR', 'timestamp_not_null' => false, - ), - 'c' => array( + ], + 'c' => [ 'type' => 'INT', 'timestamp_not_null' => false, 'generated' => true, 'expr' => '(a mod 10)', - ), - 'd' => array( + ], + 'd' => [ 'type' => 'VARCHAR', 'timestamp_not_null' => false, 'generated' => true, 'expr' => '(left(b,5))', - ), - ), - ), - ); + ], + ], + ], + ]; } } |