mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Improve ExtraPathRedirectMiddlewareTest
This commit is contained in:
parent
51d838870d
commit
fd34332e69
@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
||||
|
||||
This change applies both to the `GET /short-urls` endpoint, via the `domain` query parameter, and the `short-url:list` console command, via the `--domain`|`-d` flag.
|
||||
|
||||
* [#1774](https://github.com/shlinkio/shlink/issues/1774) Add new geolocation redirect rules for the dynamic redirects system.
|
||||
|
||||
* `geolocation-country-code`: Allows to perform redirections based on the ISO 3166-1 alpha-2 two-letter country code resolved while geolocating the visitor.
|
||||
|
||||
### Changed
|
||||
* [#2193](https://github.com/shlinkio/shlink/issues/2193) API keys are now hashed using SHA256, instead of being saved in plain text.
|
||||
|
||||
|
@ -9,6 +9,7 @@ use Laminas\Diactoros\ServerRequestFactory;
|
||||
use Laminas\Diactoros\Uri;
|
||||
use Mezzio\Router\Route;
|
||||
use Mezzio\Router\RouteResult;
|
||||
use PHPUnit\Framework\Assert;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
@ -26,6 +27,7 @@ use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\ShortUrlResolverInterface;
|
||||
use Shlinkio\Shlink\Core\Util\RedirectResponseHelperInterface;
|
||||
use Shlinkio\Shlink\Core\Visit\RequestTrackerInterface;
|
||||
use Shlinkio\Shlink\IpGeolocation\Model\Location;
|
||||
|
||||
use function Laminas\Stratigility\middleware;
|
||||
use function str_starts_with;
|
||||
@ -153,7 +155,10 @@ class ExtraPathRedirectMiddlewareTest extends TestCase
|
||||
);
|
||||
$this->redirectionBuilder->expects($this->once())->method('buildShortUrlRedirect')->with(
|
||||
$shortUrl,
|
||||
$this->isInstanceOf(ServerRequestInterface::class),
|
||||
$this->callback(function (ServerRequestInterface $req) {
|
||||
Assert::assertArrayHasKey(Location::class, $req->getAttributes());
|
||||
return true;
|
||||
}),
|
||||
$expectedExtraPath,
|
||||
)->willReturn('the_built_long_url');
|
||||
$this->redirectResponseHelper->expects($this->once())->method('buildRedirectResponse')->with(
|
||||
|
Loading…
Reference in New Issue
Block a user