Skip to content

Commit

Permalink
test: pgsql sorts differently
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 committed Nov 9, 2024
1 parent 58f910e commit c9f6fdc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Flarum\Testing\integration\TestCase;
use Flarum\User\User;
use Illuminate\Database\PostgresConnection;
use Illuminate\Database\SQLiteConnection;
use Illuminate\Support\Arr;
use PHPUnit\Framework\Attributes\Test;
Expand Down Expand Up @@ -511,10 +512,10 @@ public function custom_sort_field_works_if_set()

$this->assertEquals(200, $response->getStatusCode());

if ($this->database() instanceof SQLiteConnection) {
$this->assertEquals([2, 6, 5, 4, 1, 3], Arr::pluck($payload['data'], 'id'));
} else {
if ($this->database() instanceof PostgresConnection) {
$this->assertEquals([2, 1, 4, 5, 6, 3], Arr::pluck($payload['data'], 'id'));
} else {
$this->assertEquals([2, 6, 5, 4, 1, 3], Arr::pluck($payload['data'], 'id'));
}
}

Expand Down

0 comments on commit c9f6fdc

Please sign in to comment.