diff options
Diffstat (limited to 'tests/Builder/CreateStatementTest.php')
-rw-r--r-- | tests/Builder/CreateStatementTest.php | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/tests/Builder/CreateStatementTest.php b/tests/Builder/CreateStatementTest.php index 87c5a9b..fc24f16 100644 --- a/tests/Builder/CreateStatementTest.php +++ b/tests/Builder/CreateStatementTest.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Builder; @@ -114,19 +115,19 @@ class CreateStatementTest extends TestCase $stmt = new CreateStatement(); $stmt->name = new Expression('', 'test', ''); - $stmt->options = new OptionsArray(array('TABLE')); - $stmt->fields = array( + $stmt->options = new OptionsArray(['TABLE']); + $stmt->fields = [ new CreateDefinition( 'id', - new OptionsArray(array('NOT NULL', 'AUTO_INCREMENT')), - new DataType('INT', array(11), new OptionsArray(array('UNSIGNED'))) + new OptionsArray(['NOT NULL', 'AUTO_INCREMENT']), + new DataType('INT', [11], new OptionsArray(['UNSIGNED'])) ), new CreateDefinition( '', null, - new Key('', array(array('name' => 'id')), 'PRIMARY KEY') - ) - ); + new Key('', [['name' => 'id']], 'PRIMARY KEY') + ), + ]; $this->assertEquals( "CREATE TABLE `test` (\n" . @@ -217,8 +218,8 @@ class CreateStatementTest extends TestCase public function partitionQueries() { - return array( - array( + return [ + [ 'subparts' => <<<EOT CREATE TABLE `ts` ( `id` int(11) DEFAULT NULL, @@ -241,8 +242,9 @@ SUBPARTITION s5 ENGINE=InnoDB ) ) EOT - ), - array( + , + ], + [ 'parts' => <<<EOT CREATE TABLE ptest ( `event_date` date NOT NULL @@ -256,14 +258,15 @@ PARTITION p3 ENGINE=InnoDB, PARTITION p4 ENGINE=InnoDB ) EOT - ) - ); + , + ], + ]; } /** - * @dataProvider partitionQueries - * * @param string $query + * + * @dataProvider partitionQueries */ public function testBuilderPartitionsEngine($query) { @@ -304,9 +307,9 @@ EOT { $stmt = new CreateStatement(); - $stmt->options = new OptionsArray(array('TRIGGER')); + $stmt->options = new OptionsArray(['TRIGGER']); $stmt->name = new Expression('ins_sum'); - $stmt->entityOptions = new OptionsArray(array('BEFORE', 'INSERT')); + $stmt->entityOptions = new OptionsArray(['BEFORE', 'INSERT']); $stmt->table = new Expression('account'); $stmt->body = 'SET @sum = @sum + NEW.amount'; |