Skip to content

Commit 49f2a11

Browse files
committed
Update tests
1 parent 77cc3fe commit 49f2a11

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/Hybrid/CreateTable/SortKeysTest.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,36 @@ public function it_adds_a_dual_sort_key()
8282
);
8383
}
8484

85+
/** @test */
86+
public function it_adds_a_dual_sort_key_with_desc_direction()
87+
{
88+
$blueprint = $this->createTable(function (Blueprint $table) {
89+
$table->string('f_name');
90+
$table->string('l_name');
91+
$table->sortKey(['f_name', 'l_name'], 'desc');
92+
});
93+
94+
$this->assertCreateStatement(
95+
$blueprint,
96+
'create table `test` (`f_name` varchar(255) not null, `l_name` varchar(255) not null, sort key(`f_name` desc, `l_name` desc))'
97+
);
98+
}
99+
100+
/** @test */
101+
public function it_adds_a_dual_sort_key_with_different_directions()
102+
{
103+
$blueprint = $this->createTable(function (Blueprint $table) {
104+
$table->string('f_name');
105+
$table->string('l_name');
106+
$table->sortKey([['f_name', 'asc'], ['l_name', 'desc']]);
107+
});
108+
109+
$this->assertCreateStatement(
110+
$blueprint,
111+
'create table `test` (`f_name` varchar(255) not null, `l_name` varchar(255) not null, sort key(`f_name` asc, `l_name` desc))'
112+
);
113+
}
114+
85115
/** @test */
86116
public function shard_and_sort_keys()
87117
{

0 commit comments

Comments
 (0)