mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-30 13:31:59 +03:00
Fix type hint in migration
This commit is contained in:
parent
da922fb2a7
commit
c4fd3a74c5
3 changed files with 5 additions and 5 deletions
|
@ -46,7 +46,7 @@
|
||||||
"shlinkio/shlink-common": "^6.0",
|
"shlinkio/shlink-common": "^6.0",
|
||||||
"shlinkio/shlink-config": "^3.0",
|
"shlinkio/shlink-config": "^3.0",
|
||||||
"shlinkio/shlink-event-dispatcher": "^4.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-installer": "^9.0",
|
||||||
"shlinkio/shlink-ip-geolocation": "^4.0",
|
"shlinkio/shlink-ip-geolocation": "^4.0",
|
||||||
"shlinkio/shlink-json": "^1.1",
|
"shlinkio/shlink-json": "^1.1",
|
||||||
|
|
|
@ -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()
|
$this->connection->createQueryBuilder()
|
||||||
->insert('short_url_visits_counts')
|
->insert('short_url_visits_counts')
|
||||||
|
|
|
@ -40,7 +40,7 @@ class ShortUrlVisitsCountTrackerTest extends DatabaseTestCase
|
||||||
self::assertCount(1, $result);
|
self::assertCount(1, $result);
|
||||||
self::assertEquals('1', $result[0]->count);
|
self::assertEquals('1', $result[0]->count);
|
||||||
self::assertGreaterThanOrEqual(0, $result[0]->slotId);
|
self::assertGreaterThanOrEqual(0, $result[0]->slotId);
|
||||||
self::assertLessThan(100, $result[0]->slotId);
|
self::assertLessThanOrEqual(100, $result[0]->slotId);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Test]
|
#[Test]
|
||||||
|
@ -49,7 +49,7 @@ class ShortUrlVisitsCountTrackerTest extends DatabaseTestCase
|
||||||
$shortUrl = ShortUrl::createFake();
|
$shortUrl = ShortUrl::createFake();
|
||||||
$this->getEntityManager()->persist($shortUrl);
|
$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()->persist(new ShortUrlVisitsCount($shortUrl, slotId: $i));
|
||||||
}
|
}
|
||||||
$this->getEntityManager()->flush();
|
$this->getEntityManager()->flush();
|
||||||
|
@ -69,7 +69,7 @@ class ShortUrlVisitsCountTrackerTest extends DatabaseTestCase
|
||||||
static fn (ShortUrlVisitsCount $item) => ((int) $item->count) > 1,
|
static fn (ShortUrlVisitsCount $item) => ((int) $item->count) > 1,
|
||||||
));
|
));
|
||||||
|
|
||||||
self::assertCount(100, $result);
|
self::assertCount(101, $result);
|
||||||
self::assertCount(1, $itemsWithCountBiggerThanOnce);
|
self::assertCount(1, $itemsWithCountBiggerThanOnce);
|
||||||
self::assertEquals('2', $itemsWithCountBiggerThanOnce[0]->count);
|
self::assertEquals('2', $itemsWithCountBiggerThanOnce[0]->count);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue