1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Mon, 17 Feb 2025 12:20:58 +0100
Subject: Modernize PHPUnit syntax
---
tests/AuthorizationTest.php | 3 +++
tests/Jwt/LcobucciFactoryTest.php | 2 ++
tests/UpdateTest.php | 2 ++
3 files changed, 7 insertions(+)
diff --git a/tests/AuthorizationTest.php b/tests/AuthorizationTest.php
index 3a181a6..6e519d8 100644
--- a/tests/AuthorizationTest.php
+++ b/tests/AuthorizationTest.php
@@ -14,6 +14,7 @@ declare(strict_types=1);
namespace Symfony\Component\Mercure\Tests;
use Lcobucci\JWT\Signer\Key\InMemory;
+use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
@@ -104,6 +105,7 @@ class AuthorizationTest extends TestCase
/**
* @dataProvider provideApplicableCookieDomains
*/
+ #[DataProvider('provideApplicableCookieDomains')]
public function testApplicableCookieDomains(?string $expected, string $hubUrl, string $requestUrl)
{
if (!class_exists(InMemory::class)) {
@@ -136,6 +138,7 @@ class AuthorizationTest extends TestCase
/**
* @dataProvider provideNonApplicableCookieDomains
*/
+ #[DataProvider('provideNonApplicableCookieDomains')]
public function testNonApplicableCookieDomains(string $hubUrl, string $requestUrl)
{
if (!class_exists(InMemory::class)) {
diff --git a/tests/Jwt/LcobucciFactoryTest.php b/tests/Jwt/LcobucciFactoryTest.php
index 69b3de0..2f8c8cf 100644
--- a/tests/Jwt/LcobucciFactoryTest.php
+++ b/tests/Jwt/LcobucciFactoryTest.php
@@ -14,6 +14,7 @@ declare(strict_types=1);
namespace Symfony\Component\Mercure\Tests\Jwt;
use Lcobucci\JWT\Signer\Key;
+use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mercure\Exception\InvalidArgumentException;
use Symfony\Component\Mercure\Jwt\LcobucciFactory;
@@ -67,6 +68,7 @@ TZCHmg89ySLBfCAspVeo63o/R7bs9a7BP9x2h5uwCBogSvkEwhhPKnboVN45bp9c
/**
* @dataProvider provideCreateCases
*/
+ #[DataProvider('provideCreateCases')]
public function testCreate(string $secret, string $algorithm, ?array $subscribe, ?array $publish, array $additionalClaims, string $expectedJwt)
{
\assert('' !== $secret);
diff --git a/tests/UpdateTest.php b/tests/UpdateTest.php
index 1a3cc01..e2e6005 100644
--- a/tests/UpdateTest.php
+++ b/tests/UpdateTest.php
@@ -14,6 +14,7 @@ declare(strict_types=1);
namespace Symfony\Component\Mercure\Tests;
use PHPUnit\Framework\TestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\Mercure\Update;
/**
@@ -24,6 +25,7 @@ class UpdateTest extends TestCase
/**
* @dataProvider updateProvider
*/
+ #[DataProvider('updateProvider')]
public function testCreateUpdate($topics, $data, bool $private = false, ?string $id = null, ?string $type = null, ?int $retry = null)
{
$update = new Update($topics, $data, $private, $id, $type, $retry);
|