mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Merge pull request #1672 from acelaya-forks/feature/domain
Replace references to doma.in with s.test
This commit is contained in:
commit
de5b895fad
33 changed files with 100 additions and 100 deletions
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -1453,7 +1453,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
|||
|
||||
Endpoints and commands which create short URLs support providing the `domain` now (via query param or CLI flag). If not provided, the short URLs will still be "attached" to the default domain.
|
||||
|
||||
Custom slugs can be created on multiple domains, allowing to share links like `https://doma.in/my-campaign` and `https://example.com/my-campaign`, under the same shlink instance.
|
||||
Custom slugs can be created on multiple domains, allowing to share links like `https://s.test/my-campaign` and `https://example.com/my-campaign`, under the same shlink instance.
|
||||
|
||||
When resolving a short URL to redirect end users, the following rules are applied:
|
||||
|
||||
|
@ -1916,7 +1916,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
|||
```json
|
||||
{
|
||||
"shortCode": "12Kb3",
|
||||
"shortUrl": "https://doma.in/12Kb3",
|
||||
"shortUrl": "https://s.test/12Kb3",
|
||||
"longUrl": "https://shlink.io",
|
||||
"dateCreated": "2016-05-01T20:34:16+02:00",
|
||||
"visitsCount": 1029,
|
||||
|
@ -1983,7 +1983,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
|||
* [#174](https://github.com/shlinkio/shlink/issues/174) Fixed geolocation not working due to a deprecation on used service.
|
||||
* [#172](https://github.com/shlinkio/shlink/issues/172) Documented missing filtering params for `[GET] /short-codes/{shortCode}/visits` API endpoint, which allow the list to be filtered by date range.
|
||||
|
||||
For example: `https://doma.in/rest/v1/short-urls/abc123/visits?startDate=2017-05-23&endDate=2017-10-05`
|
||||
For example: `https://s.test/rest/v1/short-urls/abc123/visits?startDate=2017-05-23&endDate=2017-10-05`
|
||||
|
||||
* [#169](https://github.com/shlinkio/shlink/issues/169) Fixed unhandled error when parsing `ShortUrlMeta` and date fields are already `DateTime` instances.
|
||||
|
||||
|
@ -2055,7 +2055,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
|||
|
||||
This eases integration with third party services.
|
||||
|
||||
With this feature, a simple request to a URL like `https://doma.in/rest/v1/short-codes/shorten?apiKey=[YOUR_API_KEY]&longUrl=[URL_TO_BE_SHORTENED]` would return the shortened one in JSON or plain text format.
|
||||
With this feature, a simple request to a URL like `https://s.test/rest/v1/short-codes/shorten?apiKey=[YOUR_API_KEY]&longUrl=[URL_TO_BE_SHORTENED]` would return the shortened one in JSON or plain text format.
|
||||
|
||||
### Changed
|
||||
* *Nothing*
|
||||
|
@ -2091,7 +2091,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
|||
### Added
|
||||
* [#125](https://github.com/shlinkio/shlink/issues/125) Implemented a path which returns a 1px image instead of a redirection.
|
||||
|
||||
Useful to track emails. Just add an image pointing to a URL like `https://doma.in/abc123/track` to any email and an invisible image will be generated tracking every time the email is opened.
|
||||
Useful to track emails. Just add an image pointing to a URL like `https://s.test/abc123/track` to any email and an invisible image will be generated tracking every time the email is opened.
|
||||
|
||||
* [#132](https://github.com/shlinkio/shlink/issues/132) Added infection to improve tests
|
||||
|
||||
|
@ -2372,7 +2372,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
|||
### Added
|
||||
* [#46](https://github.com/shlinkio/shlink/issues/46) Defined a route that returns a QR code representing the shortened URL.
|
||||
|
||||
In order to get the QR code URL, use a pattern like `https://doma.in/abc123/qr-code`
|
||||
In order to get the QR code URL, use a pattern like `https://s.test/abc123/qr-code`
|
||||
|
||||
* [#32](https://github.com/shlinkio/shlink/issues/32) Added support for other cache adapters by improving the Cache factory
|
||||
* [#14](https://github.com/shlinkio/shlink/issues/14) Added logger and enabled errors logging
|
||||
|
|
|
@ -84,7 +84,7 @@ $buildDbConnection = static function (): array {
|
|||
return match ($driver) {
|
||||
'sqlite' => [
|
||||
'driver' => 'pdo_sqlite',
|
||||
'path' => sys_get_temp_dir() . '/shlink-tests.db',
|
||||
'memory' => true,
|
||||
],
|
||||
'postgres' => [
|
||||
'driver' => 'pdo_pgsql',
|
||||
|
@ -131,7 +131,7 @@ return [
|
|||
'url_shortener' => [
|
||||
'domain' => [
|
||||
'schema' => 'http',
|
||||
'hostname' => 'doma.in',
|
||||
'hostname' => 's.test',
|
||||
],
|
||||
],
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<VirtualHost *:80>
|
||||
ServerName doma.in
|
||||
ServerName s.test
|
||||
DocumentRoot "/path/to/shlink/public"
|
||||
|
||||
<Directory "/path/to/shlink/public">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
server {
|
||||
server_name doma.in;
|
||||
server_name s.test;
|
||||
listen 80;
|
||||
root /path/to/shlink/public;
|
||||
index index.php;
|
||||
|
|
|
@ -11,7 +11,7 @@ It exposes a shlink instance served with [openswoole](https://openswoole.com/),
|
|||
|
||||
The most basic way to run Shlink's docker image is by providing these mandatory env vars.
|
||||
|
||||
* `DEFAULT_DOMAIN`: The default short domain used for this shlink instance. For example **doma.in**.
|
||||
* `DEFAULT_DOMAIN`: The default short domain used for this shlink instance. For example **s.test**.
|
||||
* `IS_HTTPS_ENABLED`: Either **true** or **false**. Tells if Shlink is being served with HTTPs or not.
|
||||
* `GEOLITE_LICENSE_KEY`: Your GeoLite2 license key. [Learn more](https://shlink.io/documentation/geolite-license-key/) about this.
|
||||
|
||||
|
@ -21,7 +21,7 @@ To run shlink on top of a local docker service, and using an internal SQLite dat
|
|||
docker run \
|
||||
--name shlink \
|
||||
-p 8080:8080 \
|
||||
-e DEFAULT_DOMAIN=doma.in \
|
||||
-e DEFAULT_DOMAIN=s.test \
|
||||
-e IS_HTTPS_ENABLED=true \
|
||||
-e GEOLITE_LICENSE_KEY=kjh23ljkbndskj345 \
|
||||
shlinkio/shlink:stable
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
},
|
||||
"example": {
|
||||
"shortCode": "12C18",
|
||||
"shortUrl": "https://doma.in/12C18",
|
||||
"shortUrl": "https://s.test/12C18",
|
||||
"longUrl": "https://store.steampowered.com",
|
||||
"dateCreated": "2016-08-21T20:34:16+02:00",
|
||||
"visitsSummary": {
|
||||
|
@ -292,7 +292,7 @@
|
|||
"timezone": "America/Los_Angeles"
|
||||
},
|
||||
"potentialBot": false,
|
||||
"visitedUrl": "https://doma.in",
|
||||
"visitedUrl": "https://s.test",
|
||||
"type": "base_url"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
"data": [
|
||||
{
|
||||
"shortCode": "12C18",
|
||||
"shortUrl": "https://doma.in/12C18",
|
||||
"shortUrl": "https://s.test/12C18",
|
||||
"longUrl": "https://store.steampowered.com",
|
||||
"dateCreated": "2016-08-21T20:34:16+02:00",
|
||||
"visitsSummary": {
|
||||
|
@ -184,7 +184,7 @@
|
|||
},
|
||||
{
|
||||
"shortCode": "12Kb3",
|
||||
"shortUrl": "https://doma.in/12Kb3",
|
||||
"shortUrl": "https://s.test/12Kb3",
|
||||
"longUrl": "https://shlink.io",
|
||||
"dateCreated": "2016-05-01T20:34:16+02:00",
|
||||
"visitsSummary": {
|
||||
|
@ -318,7 +318,7 @@
|
|||
},
|
||||
"example": {
|
||||
"shortCode": "12C18",
|
||||
"shortUrl": "https://doma.in/12C18",
|
||||
"shortUrl": "https://s.test/12C18",
|
||||
"longUrl": "https://store.steampowered.com",
|
||||
"dateCreated": "2016-08-21T20:34:16+02:00",
|
||||
"visitsSummary": {
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
},
|
||||
"example": {
|
||||
"longUrl": "https://github.com/shlinkio/shlink",
|
||||
"shortUrl": "https://doma.in/abc123",
|
||||
"shortUrl": "https://s.test/abc123",
|
||||
"shortCode": "abc123",
|
||||
"dateCreated": "2016-08-21T20:34:16+02:00",
|
||||
"visitsSummary": {
|
||||
|
@ -78,7 +78,7 @@
|
|||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"example": "https://doma.in/abc123"
|
||||
"example": "https://s.test/abc123"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
},
|
||||
"example": {
|
||||
"shortCode": "12Kb3",
|
||||
"shortUrl": "https://doma.in/12Kb3",
|
||||
"shortUrl": "https://s.test/12Kb3",
|
||||
"longUrl": "https://shlink.io",
|
||||
"dateCreated": "2016-05-01T20:34:16+02:00",
|
||||
"visitsSummary": {
|
||||
|
@ -160,7 +160,7 @@
|
|||
},
|
||||
"example": {
|
||||
"shortCode": "12Kb3",
|
||||
"shortUrl": "https://doma.in/12Kb3",
|
||||
"shortUrl": "https://s.test/12Kb3",
|
||||
"longUrl": "https://shlink.io",
|
||||
"dateCreated": "2016-05-01T20:34:16+02:00",
|
||||
"visitsSummary": {
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
"userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0",
|
||||
"visitLocation": null,
|
||||
"potentialBot": false,
|
||||
"visitedUrl": "https://doma.in",
|
||||
"visitedUrl": "https://s.test",
|
||||
"type": "base_url"
|
||||
},
|
||||
{
|
||||
|
@ -112,7 +112,7 @@
|
|||
"timezone": "America/Los_Angeles"
|
||||
},
|
||||
"potentialBot": false,
|
||||
"visitedUrl": "https://doma.in/foo",
|
||||
"visitedUrl": "https://s.test/foo",
|
||||
"type": "invalid_short_url"
|
||||
},
|
||||
{
|
||||
|
@ -121,7 +121,7 @@
|
|||
"userAgent": "some_web_crawler/1.4",
|
||||
"visitLocation": null,
|
||||
"potentialBot": true,
|
||||
"visitedUrl": "https://doma.in/foo/bar/baz",
|
||||
"visitedUrl": "https://s.test/foo/bar/baz",
|
||||
"type": "regular_404"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -27,11 +27,11 @@ class ListShortUrlsTest extends CliTestCase
|
|||
| Short Code | Title | Short URL | Long URL | Date created | Visits count |
|
||||
+--------------------+---------------+-------------------------------------------+-----------------------------------------------------------------------------------------------------------+---------------------------+--------------+
|
||||
| ghi789 | | http://example.com/ghi789 | https://blog.alejandrocelaya.com/2019/04/27/considerations-to-properly-use-open-source-software-projects/ | 2019-01-01T00:00:30+00:00 | 0 |
|
||||
| custom | | http://doma.in/custom | https://shlink.io | 2019-01-01T00:00:20+00:00 | 0 |
|
||||
| def456 | | http://doma.in/def456 | https://blog.alejandrocelaya.com/2017/12/09/acmailer-7-0-the-most-important-release-in-a-long-time/ | 2019-01-01T00:00:10+00:00 | 2 |
|
||||
| custom | | http://s.test/custom | https://shlink.io | 2019-01-01T00:00:20+00:00 | 0 |
|
||||
| def456 | | http://s.test/def456 | https://blog.alejandrocelaya.com/2017/12/09/acmailer-7-0-the-most-important-release-in-a-long-time/ | 2019-01-01T00:00:10+00:00 | 2 |
|
||||
| custom-with-domain | | http://some-domain.com/custom-with-domain | https://google.com | 2018-10-20T00:00:00+00:00 | 0 |
|
||||
| abc123 | My cool title | http://doma.in/abc123 | https://shlink.io | 2018-05-01T00:00:00+00:00 | 3 |
|
||||
| ghi789 | | http://doma.in/ghi789 | https://shlink.io/documentation/ | 2018-05-01T00:00:00+00:00 | 2 |
|
||||
| abc123 | My cool title | http://s.test/abc123 | https://shlink.io | 2018-05-01T00:00:00+00:00 | 3 |
|
||||
| ghi789 | | http://s.test/ghi789 | https://shlink.io/documentation/ | 2018-05-01T00:00:00+00:00 | 2 |
|
||||
+--------------------+---------------+-------------------------------------------+---------------------------- Page 1 of 1 ------------------------------------------------------------------+---------------------------+--------------+
|
||||
OUTPUT];
|
||||
yield 'start date' => [['--start-date=2019-01'], <<<OUTPUT
|
||||
|
@ -39,8 +39,8 @@ class ListShortUrlsTest extends CliTestCase
|
|||
| Short Code | Title | Short URL | Long URL | Date created | Visits count |
|
||||
+------------+-------+---------------------------+-----------------------------------------------------------------------------------------------------------+---------------------------+--------------+
|
||||
| ghi789 | | http://example.com/ghi789 | https://blog.alejandrocelaya.com/2019/04/27/considerations-to-properly-use-open-source-software-projects/ | 2019-01-01T00:00:30+00:00 | 0 |
|
||||
| custom | | http://doma.in/custom | https://shlink.io | 2019-01-01T00:00:20+00:00 | 0 |
|
||||
| def456 | | http://doma.in/def456 | https://blog.alejandrocelaya.com/2017/12/09/acmailer-7-0-the-most-important-release-in-a-long-time/ | 2019-01-01T00:00:10+00:00 | 2 |
|
||||
| custom | | http://s.test/custom | https://shlink.io | 2019-01-01T00:00:20+00:00 | 0 |
|
||||
| def456 | | http://s.test/def456 | https://blog.alejandrocelaya.com/2017/12/09/acmailer-7-0-the-most-important-release-in-a-long-time/ | 2019-01-01T00:00:10+00:00 | 2 |
|
||||
+------------+-------+---------------------------+-------------------------------------------- Page 1 of 1 --------------------------------------------------+---------------------------+--------------+
|
||||
OUTPUT];
|
||||
yield 'end date' => [['-e 2018-12-01'], <<<OUTPUT
|
||||
|
@ -48,16 +48,16 @@ class ListShortUrlsTest extends CliTestCase
|
|||
| Short Code | Title | Short URL | Long URL | Date created | Visits count |
|
||||
+--------------------+---------------+-------------------------------------------+----------------------------------+---------------------------+--------------+
|
||||
| custom-with-domain | | http://some-domain.com/custom-with-domain | https://google.com | 2018-10-20T00:00:00+00:00 | 0 |
|
||||
| abc123 | My cool title | http://doma.in/abc123 | https://shlink.io | 2018-05-01T00:00:00+00:00 | 3 |
|
||||
| ghi789 | | http://doma.in/ghi789 | https://shlink.io/documentation/ | 2018-05-01T00:00:00+00:00 | 2 |
|
||||
| abc123 | My cool title | http://s.test/abc123 | https://shlink.io | 2018-05-01T00:00:00+00:00 | 3 |
|
||||
| ghi789 | | http://s.test/ghi789 | https://shlink.io/documentation/ | 2018-05-01T00:00:00+00:00 | 2 |
|
||||
+--------------------+---------------+----------------------------------- Page 1 of 1 ------------------------------+---------------------------+--------------+
|
||||
OUTPUT];
|
||||
yield 'start and end date' => [['-s 2018-06-20', '--end-date=2019-01-01T00:00:20+00:00'], <<<OUTPUT
|
||||
+--------------------+-------+-------------------------------------------+-----------------------------------------------------------------------------------------------------+---------------------------+--------------+
|
||||
| Short Code | Title | Short URL | Long URL | Date created | Visits count |
|
||||
+--------------------+-------+-------------------------------------------+-----------------------------------------------------------------------------------------------------+---------------------------+--------------+
|
||||
| custom | | http://doma.in/custom | https://shlink.io | 2019-01-01T00:00:20+00:00 | 0 |
|
||||
| def456 | | http://doma.in/def456 | https://blog.alejandrocelaya.com/2017/12/09/acmailer-7-0-the-most-important-release-in-a-long-time/ | 2019-01-01T00:00:10+00:00 | 2 |
|
||||
| custom | | http://s.test/custom | https://shlink.io | 2019-01-01T00:00:20+00:00 | 0 |
|
||||
| def456 | | http://s.test/def456 | https://blog.alejandrocelaya.com/2017/12/09/acmailer-7-0-the-most-important-release-in-a-long-time/ | 2019-01-01T00:00:10+00:00 | 2 |
|
||||
| custom-with-domain | | http://some-domain.com/custom-with-domain | https://google.com | 2018-10-20T00:00:00+00:00 | 0 |
|
||||
+--------------------+-------+-------------------------------------------+----------------------------- Page 1 of 1 -----------------------------------------------------------+---------------------------+--------------+
|
||||
OUTPUT];
|
||||
|
@ -66,8 +66,8 @@ class ListShortUrlsTest extends CliTestCase
|
|||
| Short Code | Title | Short URL | Long URL | Date created | Visits count |
|
||||
+--------------------+-------+-------------------------------------------+-----------------------------------------------------------------------------------------------------------+---------------------------+--------------+
|
||||
| ghi789 | | http://example.com/ghi789 | https://blog.alejandrocelaya.com/2019/04/27/considerations-to-properly-use-open-source-software-projects/ | 2019-01-01T00:00:30+00:00 | 0 |
|
||||
| custom | | http://doma.in/custom | https://shlink.io | 2019-01-01T00:00:20+00:00 | 0 |
|
||||
| def456 | | http://doma.in/def456 | https://blog.alejandrocelaya.com/2017/12/09/acmailer-7-0-the-most-important-release-in-a-long-time/ | 2019-01-01T00:00:10+00:00 | 2 |
|
||||
| custom | | http://s.test/custom | https://shlink.io | 2019-01-01T00:00:20+00:00 | 0 |
|
||||
| def456 | | http://s.test/def456 | https://blog.alejandrocelaya.com/2017/12/09/acmailer-7-0-the-most-important-release-in-a-long-time/ | 2019-01-01T00:00:10+00:00 | 2 |
|
||||
| custom-with-domain | | http://some-domain.com/custom-with-domain | https://google.com | 2018-10-20T00:00:00+00:00 | 0 |
|
||||
+--------------------+-------+-------------------------------------------+-------------------------------- Page 1 of 1 --------------------------------------------------------------+---------------------------+--------------+
|
||||
OUTPUT];
|
||||
|
|
|
@ -44,7 +44,7 @@ class GetDomainVisitsCommandTest extends TestCase
|
|||
$visit = Visit::forValidShortUrl($shortUrl, new Visitor('bar', 'foo', '', ''))->locate(
|
||||
VisitLocation::fromGeolocation(new Location('', 'Spain', '', 'Madrid', 0, 0, '')),
|
||||
);
|
||||
$domain = 'doma.in';
|
||||
$domain = 's.test';
|
||||
$this->visitsHelper->expects($this->once())->method('visitsForDomain')->with(
|
||||
$domain,
|
||||
$this->anything(),
|
||||
|
|
|
@ -41,7 +41,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
|||
$this->getEntityManager()->persist($withDomain);
|
||||
|
||||
$withDomainDuplicatingRegular = ShortUrl::create(ShortUrlCreation::fromRawData(
|
||||
['domain' => 'doma.in', 'customSlug' => 'foo', 'longUrl' => 'foo_with_domain'],
|
||||
['domain' => 's.test', 'customSlug' => 'foo', 'longUrl' => 'foo_with_domain'],
|
||||
));
|
||||
$this->getEntityManager()->persist($withDomainDuplicatingRegular);
|
||||
|
||||
|
@ -59,7 +59,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
|||
self::assertSame(
|
||||
$withDomainDuplicatingRegular,
|
||||
$this->repo->findOneWithDomainFallback(
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain($withDomainDuplicatingRegular->getShortCode(), 'doma.in'),
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain($withDomainDuplicatingRegular->getShortCode(), 's.test'),
|
||||
),
|
||||
);
|
||||
self::assertSame($regularOne, $this->repo->findOneWithDomainFallback(ShortUrlIdentifier::fromShortCodeAndDomain(
|
||||
|
@ -84,7 +84,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
|||
$this->getEntityManager()->persist($shortUrlWithoutDomain);
|
||||
|
||||
$shortUrlWithDomain = ShortUrl::create(
|
||||
ShortUrlCreation::fromRawData(['domain' => 'doma.in', 'customSlug' => 'another-slug', 'longUrl' => 'foo']),
|
||||
ShortUrlCreation::fromRawData(['domain' => 's.test', 'customSlug' => 'another-slug', 'longUrl' => 'foo']),
|
||||
);
|
||||
$this->getEntityManager()->persist($shortUrlWithDomain);
|
||||
|
||||
|
@ -92,7 +92,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
|||
|
||||
self::assertTrue($this->repo->shortCodeIsInUse(ShortUrlIdentifier::fromShortCodeAndDomain('my-cool-slug')));
|
||||
self::assertFalse($this->repo->shortCodeIsInUse(
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain('my-cool-slug', 'doma.in'),
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain('my-cool-slug', 's.test'),
|
||||
));
|
||||
self::assertFalse($this->repo->shortCodeIsInUse(ShortUrlIdentifier::fromShortCodeAndDomain('slug-not-in-use')));
|
||||
self::assertFalse($this->repo->shortCodeIsInUse(ShortUrlIdentifier::fromShortCodeAndDomain('another-slug')));
|
||||
|
@ -100,7 +100,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
|||
ShortUrlIdentifier::fromShortCodeAndDomain('another-slug', 'example.com'),
|
||||
));
|
||||
self::assertTrue($this->repo->shortCodeIsInUse(
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain('another-slug', 'doma.in'),
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain('another-slug', 's.test'),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -113,21 +113,21 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
|||
$this->getEntityManager()->persist($shortUrlWithoutDomain);
|
||||
|
||||
$shortUrlWithDomain = ShortUrl::create(
|
||||
ShortUrlCreation::fromRawData(['domain' => 'doma.in', 'customSlug' => 'another-slug', 'longUrl' => 'foo']),
|
||||
ShortUrlCreation::fromRawData(['domain' => 's.test', 'customSlug' => 'another-slug', 'longUrl' => 'foo']),
|
||||
);
|
||||
$this->getEntityManager()->persist($shortUrlWithDomain);
|
||||
|
||||
$this->getEntityManager()->flush();
|
||||
|
||||
self::assertNotNull($this->repo->findOne(ShortUrlIdentifier::fromShortCodeAndDomain('my-cool-slug')));
|
||||
self::assertNull($this->repo->findOne(ShortUrlIdentifier::fromShortCodeAndDomain('my-cool-slug', 'doma.in')));
|
||||
self::assertNull($this->repo->findOne(ShortUrlIdentifier::fromShortCodeAndDomain('my-cool-slug', 's.test')));
|
||||
self::assertNull($this->repo->findOne(ShortUrlIdentifier::fromShortCodeAndDomain('slug-not-in-use')));
|
||||
self::assertNull($this->repo->findOne(ShortUrlIdentifier::fromShortCodeAndDomain('another-slug')));
|
||||
self::assertNull($this->repo->findOne(
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain('another-slug', 'example.com'),
|
||||
));
|
||||
self::assertNotNull($this->repo->findOne(
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain('another-slug', 'doma.in'),
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain('another-slug', 's.test'),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
|||
$shortUrl5 = ShortUrl::create(ShortUrlCreation::fromRawData(['maxVisits' => 3, 'longUrl' => 'foo']));
|
||||
$this->getEntityManager()->persist($shortUrl5);
|
||||
|
||||
$shortUrl6 = ShortUrl::create(ShortUrlCreation::fromRawData(['domain' => 'doma.in', 'longUrl' => 'foo']));
|
||||
$shortUrl6 = ShortUrl::create(ShortUrlCreation::fromRawData(['domain' => 's.test', 'longUrl' => 'foo']));
|
||||
$this->getEntityManager()->persist($shortUrl6);
|
||||
|
||||
$this->getEntityManager()->flush();
|
||||
|
@ -212,7 +212,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
|||
);
|
||||
self::assertSame(
|
||||
$shortUrl6,
|
||||
$this->repo->findOneMatching(ShortUrlCreation::fromRawData(['domain' => 'doma.in', 'longUrl' => 'foo'])),
|
||||
$this->repo->findOneMatching(ShortUrlCreation::fromRawData(['domain' => 's.test', 'longUrl' => 'foo'])),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -379,16 +379,16 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
|||
$shortUrlWithoutDomain = ShortUrl::fromImport($buildImported('my-cool-slug'), true);
|
||||
$this->getEntityManager()->persist($shortUrlWithoutDomain);
|
||||
|
||||
$shortUrlWithDomain = ShortUrl::fromImport($buildImported('another-slug', 'doma.in'), true);
|
||||
$shortUrlWithDomain = ShortUrl::fromImport($buildImported('another-slug', 's.test'), true);
|
||||
$this->getEntityManager()->persist($shortUrlWithDomain);
|
||||
|
||||
$this->getEntityManager()->flush();
|
||||
|
||||
self::assertNotNull($this->repo->findOneByImportedUrl($buildImported('my-cool-slug')));
|
||||
self::assertNotNull($this->repo->findOneByImportedUrl($buildImported('another-slug', 'doma.in')));
|
||||
self::assertNotNull($this->repo->findOneByImportedUrl($buildImported('another-slug', 's.test')));
|
||||
self::assertNull($this->repo->findOneByImportedUrl($buildImported('non-existing-slug')));
|
||||
self::assertNull($this->repo->findOneByImportedUrl($buildImported('non-existing-slug', 'doma.in')));
|
||||
self::assertNull($this->repo->findOneByImportedUrl($buildImported('my-cool-slug', 'doma.in')));
|
||||
self::assertNull($this->repo->findOneByImportedUrl($buildImported('non-existing-slug', 's.test')));
|
||||
self::assertNull($this->repo->findOneByImportedUrl($buildImported('my-cool-slug', 's.test')));
|
||||
self::assertNull($this->repo->findOneByImportedUrl($buildImported('another-slug')));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,17 +208,17 @@ class VisitRepositoryTest extends DatabaseTestCase
|
|||
/** @test */
|
||||
public function findVisitsByDomainReturnsProperData(): void
|
||||
{
|
||||
$this->createShortUrlsAndVisits('doma.in');
|
||||
$this->createShortUrlsAndVisits('s.test');
|
||||
$this->getEntityManager()->flush();
|
||||
|
||||
self::assertCount(0, $this->repo->findVisitsByDomain('invalid', new VisitsListFiltering()));
|
||||
self::assertCount(6, $this->repo->findVisitsByDomain('DEFAULT', new VisitsListFiltering()));
|
||||
self::assertCount(3, $this->repo->findVisitsByDomain('doma.in', new VisitsListFiltering()));
|
||||
self::assertCount(1, $this->repo->findVisitsByDomain('doma.in', new VisitsListFiltering(null, true)));
|
||||
self::assertCount(2, $this->repo->findVisitsByDomain('doma.in', new VisitsListFiltering(
|
||||
self::assertCount(3, $this->repo->findVisitsByDomain('s.test', new VisitsListFiltering()));
|
||||
self::assertCount(1, $this->repo->findVisitsByDomain('s.test', new VisitsListFiltering(null, true)));
|
||||
self::assertCount(2, $this->repo->findVisitsByDomain('s.test', new VisitsListFiltering(
|
||||
DateRange::between(Chronos::parse('2016-01-02'), Chronos::parse('2016-01-03')),
|
||||
)));
|
||||
self::assertCount(1, $this->repo->findVisitsByDomain('doma.in', new VisitsListFiltering(
|
||||
self::assertCount(1, $this->repo->findVisitsByDomain('s.test', new VisitsListFiltering(
|
||||
DateRange::since(Chronos::parse('2016-01-03')),
|
||||
)));
|
||||
self::assertCount(2, $this->repo->findVisitsByDomain('DEFAULT', new VisitsListFiltering(
|
||||
|
@ -232,17 +232,17 @@ class VisitRepositoryTest extends DatabaseTestCase
|
|||
/** @test */
|
||||
public function countVisitsByDomainReturnsProperData(): void
|
||||
{
|
||||
$this->createShortUrlsAndVisits('doma.in');
|
||||
$this->createShortUrlsAndVisits('s.test');
|
||||
$this->getEntityManager()->flush();
|
||||
|
||||
self::assertEquals(0, $this->repo->countVisitsByDomain('invalid', new VisitsListFiltering()));
|
||||
self::assertEquals(6, $this->repo->countVisitsByDomain('DEFAULT', new VisitsListFiltering()));
|
||||
self::assertEquals(3, $this->repo->countVisitsByDomain('doma.in', new VisitsListFiltering()));
|
||||
self::assertEquals(1, $this->repo->countVisitsByDomain('doma.in', new VisitsListFiltering(null, true)));
|
||||
self::assertEquals(2, $this->repo->countVisitsByDomain('doma.in', new VisitsListFiltering(
|
||||
self::assertEquals(3, $this->repo->countVisitsByDomain('s.test', new VisitsListFiltering()));
|
||||
self::assertEquals(1, $this->repo->countVisitsByDomain('s.test', new VisitsListFiltering(null, true)));
|
||||
self::assertEquals(2, $this->repo->countVisitsByDomain('s.test', new VisitsListFiltering(
|
||||
DateRange::between(Chronos::parse('2016-01-02'), Chronos::parse('2016-01-03')),
|
||||
)));
|
||||
self::assertEquals(1, $this->repo->countVisitsByDomain('doma.in', new VisitsListFiltering(
|
||||
self::assertEquals(1, $this->repo->countVisitsByDomain('s.test', new VisitsListFiltering(
|
||||
DateRange::since(Chronos::parse('2016-01-03')),
|
||||
)));
|
||||
self::assertEquals(2, $this->repo->countVisitsByDomain('DEFAULT', new VisitsListFiltering(
|
||||
|
|
|
@ -241,7 +241,7 @@ class QrCodeActionTest extends TestCase
|
|||
{
|
||||
return new QrCodeAction(
|
||||
$this->urlResolver,
|
||||
new ShortUrlStringifier(['domain' => 'doma.in']),
|
||||
new ShortUrlStringifier(['domain' => 's.test']),
|
||||
new NullLogger(),
|
||||
$options ?? new QrCodeOptions(),
|
||||
);
|
||||
|
|
|
@ -61,16 +61,16 @@ class NotFoundRedirectResolverTest extends TestCase
|
|||
'baseUrl',
|
||||
];
|
||||
yield 'base URL with domain placeholder' => [
|
||||
$uri = new Uri('https://doma.in'),
|
||||
$uri = new Uri('https://s.test'),
|
||||
$this->notFoundType(ServerRequestFactory::fromGlobals()->withUri($uri)),
|
||||
new NotFoundRedirectOptions(baseUrl: 'https://redirect-here.com/{DOMAIN}'),
|
||||
'https://redirect-here.com/doma.in',
|
||||
'https://redirect-here.com/s.test',
|
||||
];
|
||||
yield 'base URL with domain placeholder in query' => [
|
||||
$uri = new Uri('https://doma.in'),
|
||||
$uri = new Uri('https://s.test'),
|
||||
$this->notFoundType(ServerRequestFactory::fromGlobals()->withUri($uri)),
|
||||
new NotFoundRedirectOptions(baseUrl: 'https://redirect-here.com/?domain={DOMAIN}'),
|
||||
'https://redirect-here.com/?domain=doma.in',
|
||||
'https://redirect-here.com/?domain=s.test',
|
||||
];
|
||||
yield 'base URL without trailing slash' => [
|
||||
$uri = new Uri(''),
|
||||
|
@ -91,12 +91,12 @@ class NotFoundRedirectResolverTest extends TestCase
|
|||
'https://redirect-here.com/?path=%2Ffoo%2Fbar',
|
||||
];
|
||||
yield 'regular 404 with multiple placeholders' => [
|
||||
$uri = new Uri('https://doma.in/foo/bar'),
|
||||
$uri = new Uri('https://s.test/foo/bar'),
|
||||
$this->notFoundType(ServerRequestFactory::fromGlobals()->withUri($uri)),
|
||||
new NotFoundRedirectOptions(
|
||||
regular404: 'https://redirect-here.com/{ORIGINAL_PATH}/{DOMAIN}/?d={DOMAIN}&p={ORIGINAL_PATH}',
|
||||
),
|
||||
'https://redirect-here.com/foo/bar/doma.in/?d=doma.in&p=%2Ffoo%2Fbar',
|
||||
'https://redirect-here.com/foo/bar/s.test/?d=s.test&p=%2Ffoo%2Fbar',
|
||||
];
|
||||
yield 'invalid short URL' => [
|
||||
new Uri('/foo'),
|
||||
|
|
|
@ -57,14 +57,14 @@ class DeleteShortUrlExceptionTest extends TestCase
|
|||
{
|
||||
$e = DeleteShortUrlException::fromVisitsThreshold(
|
||||
10,
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain('abc123', 'doma.in'),
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain('abc123', 's.test'),
|
||||
);
|
||||
$expectedMessage = 'Impossible to delete short URL with short code "abc123" for domain "doma.in", since it '
|
||||
$expectedMessage = 'Impossible to delete short URL with short code "abc123" for domain "s.test", since it '
|
||||
. 'has more than "10" visits.';
|
||||
|
||||
self::assertEquals([
|
||||
'shortCode' => 'abc123',
|
||||
'domain' => 'doma.in',
|
||||
'domain' => 's.test',
|
||||
'threshold' => 10,
|
||||
], $e->getAdditionalData());
|
||||
self::assertEquals($expectedMessage, $e->getMessage());
|
||||
|
|
|
@ -57,7 +57,7 @@ class ShortCodeUniquenessHelperTest extends TestCase
|
|||
public function provideDomains(): iterable
|
||||
{
|
||||
yield 'no domain' => [null, null];
|
||||
yield 'domain' => [Domain::withAuthority($authority = 'doma.in'), $authority];
|
||||
yield 'domain' => [Domain::withAuthority($authority = 's.test'), $authority];
|
||||
}
|
||||
|
||||
/** @test */
|
||||
|
|
|
@ -141,7 +141,7 @@ class ExtraPathRedirectMiddlewareTest extends TestCase
|
|||
$type->method('isRegularNotFound')->willReturn(true);
|
||||
$type->method('isInvalidShortUrl')->willReturn(true);
|
||||
$request = ServerRequestFactory::fromGlobals()->withAttribute(NotFoundType::class, $type)
|
||||
->withUri(new Uri('https://doma.in/shortCode/bar/baz'));
|
||||
->withUri(new Uri('https://s.test/shortCode/bar/baz'));
|
||||
$shortUrl = ShortUrl::withLongUrl('');
|
||||
|
||||
$currentIteration = 1;
|
||||
|
|
|
@ -166,6 +166,6 @@ class ShortUrlCreationTest extends TestCase
|
|||
yield 'null domain' => [null, null];
|
||||
yield 'empty domain' => ['', null];
|
||||
yield 'trimmable domain' => [' ', null];
|
||||
yield 'valid domain' => ['doma.in', 'doma.in'];
|
||||
yield 'valid domain' => ['s.test', 's.test'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ class PersistenceShortUrlRelationResolverTest extends TestCase
|
|||
|
||||
public function provideFoundDomains(): iterable
|
||||
{
|
||||
$authority = 'doma.in';
|
||||
$authority = 's.test';
|
||||
|
||||
yield 'not found domain' => [null, $authority];
|
||||
yield 'found domain' => [Domain::withAuthority($authority), $authority];
|
||||
|
|
|
@ -69,7 +69,7 @@ class OrphanVisitDataTransformerTest extends TestCase
|
|||
Visitor::fromRequest(
|
||||
ServerRequestFactory::fromGlobals()->withHeader('User-Agent', 'user-agent')
|
||||
->withHeader('Referer', 'referer')
|
||||
->withUri(new Uri('https://doma.in/foo/bar')),
|
||||
->withUri(new Uri('https://s.test/foo/bar')),
|
||||
),
|
||||
)->locate($location = VisitLocation::fromGeolocation(Location::emptyInstance())),
|
||||
[
|
||||
|
@ -78,7 +78,7 @@ class OrphanVisitDataTransformerTest extends TestCase
|
|||
'userAgent' => 'user-agent',
|
||||
'visitLocation' => $location,
|
||||
'potentialBot' => false,
|
||||
'visitedUrl' => 'https://doma.in/foo/bar',
|
||||
'visitedUrl' => 'https://s.test/foo/bar',
|
||||
'type' => VisitType::REGULAR_404->value,
|
||||
],
|
||||
];
|
||||
|
|
|
@ -297,7 +297,7 @@ class CreateShortUrlTest extends ApiTestCase
|
|||
{
|
||||
[$createStatusCode, ['shortCode' => $shortCode]] = $this->createShortUrl([
|
||||
'longUrl' => 'https://www.alejandrocelaya.com',
|
||||
'domain' => 'doma.in',
|
||||
'domain' => 's.test',
|
||||
]);
|
||||
$getResp = $this->callApiWithKey(self::METHOD_GET, '/short-urls/' . $shortCode);
|
||||
$payload = $this->getJsonResponsePayload($getResp);
|
||||
|
@ -359,7 +359,7 @@ class CreateShortUrlTest extends ApiTestCase
|
|||
self::assertEquals(self::STATUS_OK, $statusCode);
|
||||
self::assertEquals('🔥🔥🔥', $payload['title']);
|
||||
self::assertEquals('🦣🦣🦣', $payload['shortCode']);
|
||||
self::assertEquals('http://doma.in/🦣🦣🦣', $payload['shortUrl']);
|
||||
self::assertEquals('http://s.test/🦣🦣🦣', $payload['shortUrl']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -61,7 +61,7 @@ class DomainRedirectsTest extends ApiTestCase
|
|||
'invalidShortUrlRedirect' => null,
|
||||
]];
|
||||
yield 'default domain' => [[
|
||||
'domain' => 'doma.in',
|
||||
'domain' => 's.test',
|
||||
'regular404Redirect' => 'foo-for-default.com',
|
||||
], [
|
||||
'baseUrlRedirect' => null,
|
||||
|
|
|
@ -34,7 +34,7 @@ class ListDomainsTest extends ApiTestCase
|
|||
{
|
||||
yield 'admin API key' => ['valid_api_key', [
|
||||
[
|
||||
'domain' => 'doma.in',
|
||||
'domain' => 's.test',
|
||||
'isDefault' => true,
|
||||
'redirects' => [
|
||||
'baseUrlRedirect' => null,
|
||||
|
@ -72,7 +72,7 @@ class ListDomainsTest extends ApiTestCase
|
|||
]];
|
||||
yield 'author API key' => ['author_api_key', [
|
||||
[
|
||||
'domain' => 'doma.in',
|
||||
'domain' => 's.test',
|
||||
'isDefault' => true,
|
||||
'redirects' => [
|
||||
'baseUrlRedirect' => null,
|
||||
|
|
|
@ -14,7 +14,7 @@ class ListShortUrlsTest extends ApiTestCase
|
|||
{
|
||||
private const SHORT_URL_SHLINK_WITH_TITLE = [
|
||||
'shortCode' => 'abc123',
|
||||
'shortUrl' => 'http://doma.in/abc123',
|
||||
'shortUrl' => 'http://s.test/abc123',
|
||||
'longUrl' => 'https://shlink.io',
|
||||
'dateCreated' => '2018-05-01T00:00:00+00:00',
|
||||
'visitsCount' => 3,
|
||||
|
@ -36,7 +36,7 @@ class ListShortUrlsTest extends ApiTestCase
|
|||
];
|
||||
private const SHORT_URL_DOCS = [
|
||||
'shortCode' => 'ghi789',
|
||||
'shortUrl' => 'http://doma.in/ghi789',
|
||||
'shortUrl' => 'http://s.test/ghi789',
|
||||
'longUrl' => 'https://shlink.io/documentation/',
|
||||
'dateCreated' => '2018-05-01T00:00:00+00:00',
|
||||
'visitsCount' => 2,
|
||||
|
@ -80,7 +80,7 @@ class ListShortUrlsTest extends ApiTestCase
|
|||
];
|
||||
private const SHORT_URL_META = [
|
||||
'shortCode' => 'def456',
|
||||
'shortUrl' => 'http://doma.in/def456',
|
||||
'shortUrl' => 'http://s.test/def456',
|
||||
'longUrl' =>
|
||||
'https://blog.alejandrocelaya.com/2017/12/09'
|
||||
. '/acmailer-7-0-the-most-important-release-in-a-long-time/',
|
||||
|
@ -104,7 +104,7 @@ class ListShortUrlsTest extends ApiTestCase
|
|||
];
|
||||
private const SHORT_URL_CUSTOM_SLUG = [
|
||||
'shortCode' => 'custom',
|
||||
'shortUrl' => 'http://doma.in/custom',
|
||||
'shortUrl' => 'http://s.test/custom',
|
||||
'longUrl' => 'https://shlink.io',
|
||||
'dateCreated' => '2019-01-01T00:00:20+00:00',
|
||||
'visitsCount' => 0,
|
||||
|
|
|
@ -11,7 +11,7 @@ use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase;
|
|||
class OrphanVisitsTest extends ApiTestCase
|
||||
{
|
||||
private const INVALID_SHORT_URL = [
|
||||
'referer' => 'https://doma.in/foo',
|
||||
'referer' => 'https://s.test/foo',
|
||||
'date' => '2020-03-01T00:00:00+00:00',
|
||||
'userAgent' => 'cf-facebook',
|
||||
'visitLocation' => null,
|
||||
|
@ -20,7 +20,7 @@ class OrphanVisitsTest extends ApiTestCase
|
|||
'type' => 'invalid_short_url',
|
||||
];
|
||||
private const REGULAR_NOT_FOUND = [
|
||||
'referer' => 'https://doma.in/foo/bar',
|
||||
'referer' => 'https://s.test/foo/bar',
|
||||
'date' => '2020-02-01T00:00:00+00:00',
|
||||
'userAgent' => 'shlink-tests-agent',
|
||||
'visitLocation' => null,
|
||||
|
@ -29,7 +29,7 @@ class OrphanVisitsTest extends ApiTestCase
|
|||
'type' => 'regular_404',
|
||||
];
|
||||
private const BASE_URL = [
|
||||
'referer' => 'https://doma.in',
|
||||
'referer' => 'https://s.test',
|
||||
'date' => '2020-01-01T00:00:00+00:00',
|
||||
'userAgent' => 'shlink-tests-agent',
|
||||
'visitLocation' => null,
|
||||
|
|
|
@ -50,15 +50,15 @@ class VisitsFixture extends AbstractFixture implements DependentFixtureInterface
|
|||
);
|
||||
|
||||
$manager->persist($this->setVisitDate(
|
||||
Visit::forBasePath(new Visitor('shlink-tests-agent', 'https://doma.in', '1.2.3.4', '')),
|
||||
Visit::forBasePath(new Visitor('shlink-tests-agent', 'https://s.test', '1.2.3.4', '')),
|
||||
'2020-01-01',
|
||||
));
|
||||
$manager->persist($this->setVisitDate(
|
||||
Visit::forRegularNotFound(new Visitor('shlink-tests-agent', 'https://doma.in/foo/bar', '1.2.3.4', '')),
|
||||
Visit::forRegularNotFound(new Visitor('shlink-tests-agent', 'https://s.test/foo/bar', '1.2.3.4', '')),
|
||||
'2020-02-01',
|
||||
));
|
||||
$manager->persist($this->setVisitDate(
|
||||
Visit::forInvalidShortUrl(new Visitor('cf-facebook', 'https://doma.in/foo', '1.2.3.4', 'foo.com')),
|
||||
Visit::forInvalidShortUrl(new Visitor('cf-facebook', 'https://s.test/foo', '1.2.3.4', 'foo.com')),
|
||||
'2020-03-01',
|
||||
));
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class DomainRedirectsActionTest extends TestCase
|
|||
array $redirects,
|
||||
array $expectedResult,
|
||||
): void {
|
||||
$authority = 'doma.in';
|
||||
$authority = 's.test';
|
||||
$redirects['domain'] = $authority;
|
||||
$apiKey = ApiKey::create();
|
||||
$request = ServerRequestFactory::fromGlobals()->withParsedBody($redirects)
|
||||
|
|
|
@ -29,7 +29,7 @@ class ListShortUrlsActionTest extends TestCase
|
|||
|
||||
$this->action = new ListShortUrlsAction($this->service, new ShortUrlDataTransformer(
|
||||
new ShortUrlStringifier([
|
||||
'hostname' => 'doma.in',
|
||||
'hostname' => 's.test',
|
||||
'schema' => 'https',
|
||||
]),
|
||||
));
|
||||
|
|
|
@ -51,7 +51,7 @@ class CreateShortUrlContentNegotiationMiddlewareTest extends TestCase
|
|||
|
||||
$this->requestHandler->expects($this->once())->method('handle')->with(
|
||||
$this->isInstanceOf(ServerRequestInterface::class),
|
||||
)->willReturn(new JsonResponse(['shortUrl' => 'http://doma.in/foo']));
|
||||
)->willReturn(new JsonResponse(['shortUrl' => 'http://s.test/foo']));
|
||||
|
||||
$response = $this->middleware->process($request, $this->requestHandler);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class DropDefaultDomainFromRequestMiddlewareTest extends TestCase
|
|||
protected function setUp(): void
|
||||
{
|
||||
$this->next = $this->createMock(RequestHandlerInterface::class);
|
||||
$this->middleware = new DropDefaultDomainFromRequestMiddleware('doma.in');
|
||||
$this->middleware = new DropDefaultDomainFromRequestMiddleware('s.test');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -47,8 +47,8 @@ class DropDefaultDomainFromRequestMiddlewareTest extends TestCase
|
|||
{
|
||||
yield [[], []];
|
||||
yield [['foo' => 'bar'], ['foo' => 'bar']];
|
||||
yield [['foo' => 'bar', 'domain' => 'doma.in'], ['foo' => 'bar']];
|
||||
yield [['foo' => 'bar', 'domain' => 's.test'], ['foo' => 'bar']];
|
||||
yield [['foo' => 'bar', 'domain' => 'not_default'], ['foo' => 'bar', 'domain' => 'not_default']];
|
||||
yield [['domain' => 'doma.in'], []];
|
||||
yield [['domain' => 's.test'], []];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,9 +88,9 @@ class OverrideDomainMiddlewareTest extends TestCase
|
|||
[ShortUrlInputFilter::DOMAIN => 'baz.com'],
|
||||
];
|
||||
yield 'more body params' => [
|
||||
Domain::withAuthority('doma.in'),
|
||||
Domain::withAuthority('s.test'),
|
||||
[ShortUrlInputFilter::DOMAIN => 'baz.com', 'something' => 'else', 'foo' => 123],
|
||||
[ShortUrlInputFilter::DOMAIN => 'doma.in', 'something' => 'else', 'foo' => 123],
|
||||
[ShortUrlInputFilter::DOMAIN => 's.test', 'something' => 'else', 'foo' => 123],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue