mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Extract logic to match IP address against list of groups
This commit is contained in:
@@ -92,6 +92,21 @@ class RequestTrackerTest extends TestCase
|
||||
$this->requestTracker->trackIfApplicable($shortUrl, $this->request);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function trackingHappensOverShortUrlsWhenRemoteAddressIsInvalid(): void
|
||||
{
|
||||
$shortUrl = ShortUrl::withLongUrl(self::LONG_URL);
|
||||
$this->visitsTracker->expects($this->once())->method('track')->with(
|
||||
$shortUrl,
|
||||
$this->isInstanceOf(Visitor::class),
|
||||
);
|
||||
|
||||
$this->requestTracker->trackIfApplicable($shortUrl, ServerRequestFactory::fromGlobals()->withAttribute(
|
||||
IpAddressMiddlewareFactory::REQUEST_ATTR,
|
||||
'invalid',
|
||||
));
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function baseUrlErrorIsTracked(): void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user