Skip to content

Commit a976895

Browse files
committed
Add tests
1 parent 22ec785 commit a976895

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

tests/Hybrid/CreateTable/SortKeysTest.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,47 @@ public function shard_and_sort_keys()
6767
'create table `test` (`name` varchar(255) not null, shard key(`name`), sort key(`name`))'
6868
);
6969
}
70+
71+
/** @test */
72+
public function it_adds_a_sort_key_with_with_statement()
73+
{
74+
$blueprint = $this->createTable(function (Blueprint $table) {
75+
$table->string('name');
76+
$table->sortKey('name')->with(['columnstore_segment_rows' => 100000]);
77+
});
78+
79+
$this->assertCreateStatement(
80+
$blueprint,
81+
'create table `test` (`name` varchar(255) not null, sort key(`name`) with (columnstore_segment_rows=100000))'
82+
);
83+
}
84+
85+
/** @test */
86+
public function it_adds_a_sort_key_fluent_with_with_statement()
87+
{
88+
$blueprint = $this->createTable(function (Blueprint $table) {
89+
$table->string('name')->sortKey()->with(['columnstore_segment_rows' => 100000]);
90+
});
91+
92+
$this->assertCreateStatement(
93+
$blueprint,
94+
'create table `test` (`name` varchar(255) not null, sort key(`name`) with (columnstore_segment_rows=100000))'
95+
);
96+
}
97+
98+
/** @test */
99+
public function it_adds_a_sort_key_fluent_with_dual_with_statement()
100+
{
101+
$blueprint = $this->createTable(function (Blueprint $table) {
102+
$table->string('name')->sortKey()->with([
103+
'columnstore_segment_rows' => 100000,
104+
'columnstore_flush_bytes' => 4194304,
105+
]);
106+
});
107+
108+
$this->assertCreateStatement(
109+
$blueprint,
110+
'create table `test` (`name` varchar(255) not null, sort key(`name`) with (columnstore_segment_rows=100000,columnstore_flush_bytes=4194304))'
111+
);
112+
}
70113
}

0 commit comments

Comments
 (0)