Fix type hint in migration

This commit is contained in:
Alejandro Celaya 2024-03-28 16:10:56 +01:00
parent da922fb2a7
commit c4fd3a74c5
3 changed files with 5 additions and 5 deletions

View file

@ -46,7 +46,7 @@
"shlinkio/shlink-common": "^6.0",
"shlinkio/shlink-config": "^3.0",
"shlinkio/shlink-event-dispatcher": "^4.0",
"shlinkio/shlink-importer": "^5.3",
"shlinkio/shlink-importer": "^5.3.1",
"shlinkio/shlink-installer": "^9.0",
"shlinkio/shlink-ip-geolocation": "^4.0",
"shlinkio/shlink-json": "^1.1",

View file

@ -39,7 +39,7 @@ final class Version20240318084804 extends AbstractMigration
}
}
private function insertCount(string|int $shortUrlId, int $count, bool $potentialBot): void
private function insertCount(string|int $shortUrlId, string|int $count, bool $potentialBot): void
{
$this->connection->createQueryBuilder()
->insert('short_url_visits_counts')

View file

@ -40,7 +40,7 @@ class ShortUrlVisitsCountTrackerTest extends DatabaseTestCase
self::assertCount(1, $result);
self::assertEquals('1', $result[0]->count);
self::assertGreaterThanOrEqual(0, $result[0]->slotId);
self::assertLessThan(100, $result[0]->slotId);
self::assertLessThanOrEqual(100, $result[0]->slotId);
}
#[Test]
@ -49,7 +49,7 @@ class ShortUrlVisitsCountTrackerTest extends DatabaseTestCase
$shortUrl = ShortUrl::createFake();
$this->getEntityManager()->persist($shortUrl);
for ($i = 0; $i < 100; $i++) {
for ($i = 0; $i <= 100; $i++) {
$this->getEntityManager()->persist(new ShortUrlVisitsCount($shortUrl, slotId: $i));
}
$this->getEntityManager()->flush();
@ -69,7 +69,7 @@ class ShortUrlVisitsCountTrackerTest extends DatabaseTestCase
static fn (ShortUrlVisitsCount $item) => ((int) $item->count) > 1,
));
self::assertCount(100, $result);
self::assertCount(101, $result);
self::assertCount(1, $itemsWithCountBiggerThanOnce);
self::assertEquals('2', $itemsWithCountBiggerThanOnce[0]->count);
}