mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 17:23:12 +08:00
Migrate from PHPUnit annotations to native attributes
This commit is contained in:
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace ShlinkioApiTest\Shlink\Rest\Action;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase;
|
||||
use ShlinkioApiTest\Shlink\Rest\Utils\NotFoundUrlHelpersTrait;
|
||||
|
||||
@@ -13,10 +15,7 @@ class DeleteShortUrlTest extends ApiTestCase
|
||||
{
|
||||
use NotFoundUrlHelpersTrait;
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @dataProvider provideInvalidUrls
|
||||
*/
|
||||
#[Test, DataProvider('provideInvalidUrls')]
|
||||
public function notFoundErrorIsReturnWhenDeletingInvalidUrl(
|
||||
string $shortCode,
|
||||
?string $domain,
|
||||
@@ -35,10 +34,7 @@ class DeleteShortUrlTest extends ApiTestCase
|
||||
self::assertEquals($domain, $payload['domain'] ?? null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @dataProvider provideApiVersions
|
||||
*/
|
||||
#[Test, DataProvider('provideApiVersions')]
|
||||
public function expectedTypeIsReturnedBasedOnApiVersion(string $version, string $expectedType): void
|
||||
{
|
||||
$resp = $this->callApiWithKey(
|
||||
@@ -57,7 +53,7 @@ class DeleteShortUrlTest extends ApiTestCase
|
||||
yield ['3', 'https://shlink.io/api/error/short-url-not-found'];
|
||||
}
|
||||
|
||||
/** @test */
|
||||
#[Test]
|
||||
public function properShortUrlIsDeletedWhenDomainIsProvided(): void
|
||||
{
|
||||
$fetchWithDomainBefore = $this->callApiWithKey(self::METHOD_GET, '/short-urls/ghi789?domain=example.com');
|
||||
|
||||
Reference in New Issue
Block a user