Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Mar 22, 2021
1 parent aec2cbf commit bf9f357
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/Database/SelectQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,36 @@ public function testOrderByDesc3(): void
);
}

public function testOrderByTwiceBySameName(): void
{
$select = $this->database
->select()
->from(['users'])
->where(['name' => 'Anton'])
->orderBy('name', 'DESC')
->orderBy('name', 'ASC');

$this->assertSameQuery(
'SELECT * FROM {users} WHERE {name} = ? ORDER BY {name} DESC',
$select
);
}

public function testOrderByTwiceBySameNameArray(): void
{
$select = $this->database
->select()
->from(['users'])
->where(['name' => 'Anton'])
->orderBy('name', 'DESC')
->orderBy(['name' => 'ASC', 'foo' => 'DESC']);

$this->assertSameQuery(
'SELECT * FROM {users} WHERE {name} = ? ORDER BY {name} DESC, {foo} DESC',
$select
);
}

public function testMultipleOrderBy(): void
{
$select = $this->database
Expand Down

0 comments on commit bf9f357

Please sign in to comment.