From c4fd3a74c564bc84a062bee972a54102e5e0976c Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 28 Mar 2024 16:10:56 +0100 Subject: [PATCH] Fix type hint in migration --- composer.json | 2 +- module/Core/migrations/Version20240318084804.php | 2 +- .../Visit/Listener/ShortUrlVisitsCountTrackerTest.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 2179a749..8d8f33f9 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/module/Core/migrations/Version20240318084804.php b/module/Core/migrations/Version20240318084804.php index 228fa474..6ff25fac 100644 --- a/module/Core/migrations/Version20240318084804.php +++ b/module/Core/migrations/Version20240318084804.php @@ -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') diff --git a/module/Core/test-db/Visit/Listener/ShortUrlVisitsCountTrackerTest.php b/module/Core/test-db/Visit/Listener/ShortUrlVisitsCountTrackerTest.php index bfb5616f..29f5d5d1 100644 --- a/module/Core/test-db/Visit/Listener/ShortUrlVisitsCountTrackerTest.php +++ b/module/Core/test-db/Visit/Listener/ShortUrlVisitsCountTrackerTest.php @@ -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); }