mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
maybe fixed tests3
This commit is contained in:
parent
d7c9d914be
commit
7190979980
@ -82,6 +82,5 @@ trait SyntheticMongoDbTransaction
|
|||||||
{
|
{
|
||||||
DB::table($tableName)->truncate();
|
DB::table($tableName)->truncate();
|
||||||
}
|
}
|
||||||
usleep(35 * 1000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,14 +312,14 @@ abstract class JikanMediaModelFactory extends JikanModelFactory implements Media
|
|||||||
if ($additionalParams->has("min_score") && !$additionalParams->has("max_score")) {
|
if ($additionalParams->has("min_score") && !$additionalParams->has("max_score")) {
|
||||||
$min_score = floatval($additionalParams["min_score"]);
|
$min_score = floatval($additionalParams["min_score"]);
|
||||||
if ($this->isScoreValueValid($min_score)) {
|
if ($this->isScoreValueValid($min_score)) {
|
||||||
$overrides["score"] = $this->faker->randomFloat(2, 1.00, floatval($additionalParams["min_score"]));
|
$overrides["score"] = $this->faker->randomFloat(2, 1.00, floatval($additionalParams["min_score"]) - 0.01);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$additionalParams->has("min_score") && $additionalParams->has("max_score")) {
|
if (!$additionalParams->has("min_score") && $additionalParams->has("max_score")) {
|
||||||
$max_score = $additionalParams["max_score"];
|
$max_score = $additionalParams["max_score"];
|
||||||
if ($this->isScoreValueValid($max_score)) {
|
if ($this->isScoreValueValid($max_score)) {
|
||||||
$overrides["score"] = $this->faker->randomFloat(2, floatval($additionalParams["max_score"]), 9.99);
|
$overrides["score"] = $this->faker->randomFloat(2, floatval($additionalParams["max_score"]) + 0.01, 9.99);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,8 +330,8 @@ abstract class JikanMediaModelFactory extends JikanModelFactory implements Media
|
|||||||
if ($this->isScoreValueValid($min_score) && $this->isScoreValueValid($max_score))
|
if ($this->isScoreValueValid($min_score) && $this->isScoreValueValid($max_score))
|
||||||
{
|
{
|
||||||
$overrides["score"] = $this->faker->randomElement([
|
$overrides["score"] = $this->faker->randomElement([
|
||||||
$this->faker->randomFloat(2, 1.00, floatval($additionalParams["min_score"])),
|
$this->faker->randomFloat(2, 1.00, floatval($additionalParams["min_score"]) - 0.01),
|
||||||
$this->faker->randomFloat(2, floatval($additionalParams["max_score"]), 9.99)
|
$this->faker->randomFloat(2, floatval($additionalParams["max_score"]) + 0.01, 9.99)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user