Skip to content

Commit

Permalink
SDK-2745 update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyspryker committed Aug 14, 2023
1 parent 6670736 commit 3972596
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
<directory suffix="Test.php">tests/SprykerSdkTest/</directory>
</testsuite>
</testsuites>
<php>
<env name="MANIFESTS_RATING_THRESHOLD" value="0" force="true" />
</php>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ public function filterManifests(array $manifests): array
{
$requiredRating = $this->configurationProvider->getManifestsRatingThreshold();

if ($requiredRating >= static::MAX_RATING_THRESHOLD) {
if ($requiredRating <= static::MIN_RATING_THRESHOLD) {
return $manifests;
}

if ($requiredRating <= static::MIN_RATING_THRESHOLD) {
if ($requiredRating > static::MAX_RATING_THRESHOLD) {
return [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testsFilterManifestsShouldReturnTheSameManifestsWhenRatingIsMax(
//Arrange
$manifests = $this->getManifests();
$ratingBasedManifestsFilter = new RatingBasedManifestsFilter(
$this->createConfigurationProviderMock(RatingBasedManifestsFilter::MAX_RATING_THRESHOLD),
$this->createConfigurationProviderMock(RatingBasedManifestsFilter::MIN_RATING_THRESHOLD),
$this->createModuleRatingFetcherMock(new ModulesRatingResponseDto([]), false),
new ManifestToModulesRatingRequestMapper(),
);
Expand All @@ -47,7 +47,7 @@ public function testsFilterManifestsShouldReturnEmptyManifestsWhenRatingIsMin():
//Arrange
$manifests = $this->getManifests();
$ratingBasedManifestsFilter = new RatingBasedManifestsFilter(
$this->createConfigurationProviderMock(RatingBasedManifestsFilter::MIN_RATING_THRESHOLD),
$this->createConfigurationProviderMock(RatingBasedManifestsFilter::MAX_RATING_THRESHOLD + 1),
$this->createModuleRatingFetcherMock(new ModulesRatingResponseDto([]), false),
new ManifestToModulesRatingRequestMapper(),
);
Expand Down

0 comments on commit 3972596

Please sign in to comment.