Skip to content

Commit

Permalink
fix: canonicalize comparisons in Posts ListTest
Browse files Browse the repository at this point in the history
That doesn't matter since there's no default sort for posts in the backend.
  • Loading branch information
askvortsov1 authored and luceos committed Mar 31, 2022
1 parent 6839c94 commit e25c53c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions framework/core/tests/integration/api/posts/ListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function guests_cant_see_anything_if_not_allowed()
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);

$this->assertEquals([], $data['data']);
$this->assertEqualsCanonicalizing([], $data['data']);
}

/**
Expand Down Expand Up @@ -92,7 +92,7 @@ public function author_filter_works()
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);

$this->assertEquals(['1', '2'], Arr::pluck($data['data'], 'id'));
$this->assertEqualsCanonicalizing(['1', '2'], Arr::pluck($data['data'], 'id'));
}

/**
Expand All @@ -110,7 +110,7 @@ public function author_filter_works_with_multiple_values()
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);

$this->assertEquals(['1', '2', '3', '4', '5'], Arr::pluck($data['data'], 'id'));
$this->assertEqualsCanonicalizing(['1', '2', '3', '4', '5'], Arr::pluck($data['data'], 'id'));
}

/**
Expand All @@ -128,7 +128,7 @@ public function discussion_filter_works()
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);

$this->assertEquals(['1', '3'], Arr::pluck($data['data'], 'id'));
$this->assertEqualsCanonicalizing(['1', '3'], Arr::pluck($data['data'], 'id'));
}

/**
Expand All @@ -146,7 +146,7 @@ public function type_filter_works()
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);

$this->assertEquals(['5'], Arr::pluck($data['data'], 'id'));
$this->assertEqualsCanonicalizing(['5'], Arr::pluck($data['data'], 'id'));
}

/**
Expand All @@ -164,7 +164,7 @@ public function number_filter_works()
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);

$this->assertEquals(['3', '4'], Arr::pluck($data['data'], 'id'));
$this->assertEqualsCanonicalizing(['3', '4'], Arr::pluck($data['data'], 'id'));
}

/**
Expand All @@ -182,7 +182,7 @@ public function id_filter_works()
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);

$this->assertEquals(['4'], Arr::pluck($data['data'], 'id'));
$this->assertEqualsCanonicalizing(['4'], Arr::pluck($data['data'], 'id'));
}

/**
Expand All @@ -200,6 +200,6 @@ public function id_filter_works_with_multiple_ids()
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);

$this->assertEquals(['1', '3', '5'], Arr::pluck($data['data'], 'id'));
$this->assertEqualsCanonicalizing(['1', '3', '5'], Arr::pluck($data['data'], 'id'));
}
}

0 comments on commit e25c53c

Please sign in to comment.