mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 17:44:44 +08:00
Migrate from PHPUnit annotations to native attributes
This commit is contained in:
@@ -6,6 +6,8 @@ namespace ShlinkioApiTest\Shlink\Rest\Action;
|
||||
|
||||
use GuzzleHttp\Psr7\Query;
|
||||
use Laminas\Diactoros\Uri;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use Shlinkio\Shlink\Common\Paginator\Paginator;
|
||||
use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase;
|
||||
use ShlinkioApiTest\Shlink\Rest\Utils\NotFoundUrlHelpersTrait;
|
||||
@@ -16,10 +18,7 @@ class ShortUrlVisitsTest extends ApiTestCase
|
||||
{
|
||||
use NotFoundUrlHelpersTrait;
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @dataProvider provideInvalidUrls
|
||||
*/
|
||||
#[Test, DataProvider('provideInvalidUrls')]
|
||||
public function tryingToGetVisitsForInvalidUrlReturnsNotFoundError(
|
||||
string $shortCode,
|
||||
?string $domain,
|
||||
@@ -43,10 +42,7 @@ class ShortUrlVisitsTest extends ApiTestCase
|
||||
self::assertEquals($domain, $payload['domain'] ?? null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @dataProvider provideDomains
|
||||
*/
|
||||
#[Test, DataProvider('provideDomains')]
|
||||
public function properVisitsAreReturnedWhenDomainIsProvided(?string $domain, int $expectedAmountOfVisits): void
|
||||
{
|
||||
$shortCode = 'ghi789';
|
||||
@@ -72,10 +68,7 @@ class ShortUrlVisitsTest extends ApiTestCase
|
||||
yield 'no domain' => [null, 2];
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @dataProvider provideVisitsForBots
|
||||
*/
|
||||
#[Test, DataProvider('provideVisitsForBots')]
|
||||
public function properVisitsAreReturnedWhenExcludingBots(bool $excludeBots, int $expectedAmountOfVisits): void
|
||||
{
|
||||
$shortCode = 'def456';
|
||||
|
||||
Reference in New Issue
Block a user