From fe9876e037f6526d620bbf5c619ce546e03269ac Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Thu, 28 Mar 2024 10:21:11 +0100 Subject: [PATCH] namespace the phpunit attributes for clarity --- doc/testing-your-application.rst | 6 +++--- tests/Functional/CacheInvalidatorTest.php | 4 ++-- tests/Functional/ProxyClient/NginxProxyClientTest.php | 6 +++--- tests/Functional/ProxyClient/SymfonyProxyClientTest.php | 6 +++--- tests/Functional/ProxyClient/VarnishProxyClientTest.php | 6 +++--- tests/Functional/Symfony/EventDispatchingHttpCacheTest.php | 4 ++-- tests/Functional/Varnish/CustomTtlTest.php | 6 +++--- tests/Functional/Varnish/UserContextCacheTest.php | 6 +++--- tests/Functional/Varnish/UserContextFailureTest.php | 6 +++--- tests/Functional/Varnish/UserContextNocacheTest.php | 6 +++--- tests/Functional/Varnish/UserContextTestCase.php | 6 +++--- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/doc/testing-your-application.rst b/doc/testing-your-application.rst index eb15d6ae..8c2d0346 100644 --- a/doc/testing-your-application.rst +++ b/doc/testing-your-application.rst @@ -54,11 +54,11 @@ use PHP’s built in web server. Include the WebServerSubscriber in your Then set the ``webserver`` group on your test to start PHP’s web server before it runs:: + use PHPUnit\Framework\Attributes as PHPUnit; + class YourTest extends \PHPUnit_Framework_TestCase { - /** - * @group webserver - */ + #[PHPUnit\Group('webserver')] public function testYourApp() { // The web server will be started before this test code runs and diff --git a/tests/Functional/CacheInvalidatorTest.php b/tests/Functional/CacheInvalidatorTest.php index c9f76010..9efae81b 100644 --- a/tests/Functional/CacheInvalidatorTest.php +++ b/tests/Functional/CacheInvalidatorTest.php @@ -13,9 +13,9 @@ use FOS\HttpCache\CacheInvalidator; use FOS\HttpCache\Test\VarnishTestCase; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes as PHPUnit; -#[Group('webserver')] +#[PHPUnit\Group('webserver')] class CacheInvalidatorTest extends VarnishTestCase { public function testInvalidateTags(): void diff --git a/tests/Functional/ProxyClient/NginxProxyClientTest.php b/tests/Functional/ProxyClient/NginxProxyClientTest.php index c21fac15..e9ee423f 100644 --- a/tests/Functional/ProxyClient/NginxProxyClientTest.php +++ b/tests/Functional/ProxyClient/NginxProxyClientTest.php @@ -12,10 +12,10 @@ namespace FOS\HttpCache\Tests\Functional\ProxyClient; use FOS\HttpCache\Test\NginxTestCase; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes as PHPUnit; -#[Group('webserver')] -#[Group('nginx')] +#[PHPUnit\Group('webserver')] +#[PHPUnit\Group('nginx')] class NginxProxyClientTest extends NginxTestCase { use PurgeAssertions; diff --git a/tests/Functional/ProxyClient/SymfonyProxyClientTest.php b/tests/Functional/ProxyClient/SymfonyProxyClientTest.php index be92e6e4..2d77b787 100644 --- a/tests/Functional/ProxyClient/SymfonyProxyClientTest.php +++ b/tests/Functional/ProxyClient/SymfonyProxyClientTest.php @@ -12,11 +12,11 @@ namespace FOS\HttpCache\Tests\Functional\ProxyClient; use FOS\HttpCache\Test\SymfonyTestCase; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes as PHPUnit; use Toflar\Psr6HttpCacheStore\Psr6Store; -#[Group('webserver')] -#[Group('symfony')] +#[PHPUnit\Group('webserver')] +#[PHPUnit\Group('symfony')] class SymfonyProxyClientTest extends SymfonyTestCase { use InvalidateTagsAssertions; diff --git a/tests/Functional/ProxyClient/VarnishProxyClientTest.php b/tests/Functional/ProxyClient/VarnishProxyClientTest.php index a07c04a3..9ee6bc15 100644 --- a/tests/Functional/ProxyClient/VarnishProxyClientTest.php +++ b/tests/Functional/ProxyClient/VarnishProxyClientTest.php @@ -13,10 +13,10 @@ use FOS\HttpCache\ProxyClient\Varnish; use FOS\HttpCache\Test\VarnishTestCase; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes as PHPUnit; -#[Group('webserver')] -#[Group('varnish')] +#[PHPUnit\Group('webserver')] +#[PHPUnit\Group('varnish')] class VarnishProxyClientTest extends VarnishTestCase { use BanAssertions; diff --git a/tests/Functional/Symfony/EventDispatchingHttpCacheTest.php b/tests/Functional/Symfony/EventDispatchingHttpCacheTest.php index 3b54d3a6..a3a36b1b 100644 --- a/tests/Functional/Symfony/EventDispatchingHttpCacheTest.php +++ b/tests/Functional/Symfony/EventDispatchingHttpCacheTest.php @@ -20,7 +20,7 @@ use FOS\HttpCache\SymfonyCache\RefreshListener; use FOS\HttpCache\SymfonyCache\UserContextListener; use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes as PHPUnit; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -28,7 +28,7 @@ use Symfony\Component\HttpKernel\HttpCache\StoreInterface; use Symfony\Component\HttpKernel\HttpKernelInterface; -#[Group('symfony')] +#[PHPUnit\Group('symfony')] class EventDispatchingHttpCacheTest extends TestCase { use MockeryPHPUnitIntegration; diff --git a/tests/Functional/Varnish/CustomTtlTest.php b/tests/Functional/Varnish/CustomTtlTest.php index 2c693cb3..d89a6ca6 100644 --- a/tests/Functional/Varnish/CustomTtlTest.php +++ b/tests/Functional/Varnish/CustomTtlTest.php @@ -12,10 +12,10 @@ namespace FOS\HttpCache\Tests\Functional\Varnish; use FOS\HttpCache\Test\VarnishTestCase; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes as PHPUnit; -#[Group('webserver')] -#[Group('varnish')] +#[PHPUnit\Group('webserver')] +#[PHPUnit\Group('varnish')] class CustomTtlTest extends VarnishTestCase { protected function getConfigFile(): string diff --git a/tests/Functional/Varnish/UserContextCacheTest.php b/tests/Functional/Varnish/UserContextCacheTest.php index 7d913bf9..598d3a49 100644 --- a/tests/Functional/Varnish/UserContextCacheTest.php +++ b/tests/Functional/Varnish/UserContextCacheTest.php @@ -11,10 +11,10 @@ namespace FOS\HttpCache\Tests\Functional\Varnish; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes as PHPUnit; -#[Group('webserver')] -#[Group('varnish')] +#[PHPUnit\Group('webserver')] +#[PHPUnit\Group('varnish')] class UserContextCacheTest extends UserContextTestCase { protected function getConfigFile(): string diff --git a/tests/Functional/Varnish/UserContextFailureTest.php b/tests/Functional/Varnish/UserContextFailureTest.php index 5bf03413..93089919 100644 --- a/tests/Functional/Varnish/UserContextFailureTest.php +++ b/tests/Functional/Varnish/UserContextFailureTest.php @@ -12,10 +12,10 @@ namespace FOS\HttpCache\Tests\Functional\Varnish; use FOS\HttpCache\Test\VarnishTestCase; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes as PHPUnit; -#[Group('webserver')] -#[Group('varnish')] +#[PHPUnit\Group('webserver')] +#[PHPUnit\Group('varnish')] class UserContextFailureTest extends VarnishTestCase { /** diff --git a/tests/Functional/Varnish/UserContextNocacheTest.php b/tests/Functional/Varnish/UserContextNocacheTest.php index f6fb01e9..da8f4345 100644 --- a/tests/Functional/Varnish/UserContextNocacheTest.php +++ b/tests/Functional/Varnish/UserContextNocacheTest.php @@ -11,10 +11,10 @@ namespace FOS\HttpCache\Tests\Functional\Varnish; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes as PHPUnit; -#[Group('webserver')] -#[Group('varnish')] +#[PHPUnit\Group('webserver')] +#[PHPUnit\Group('varnish')] class UserContextNocacheTest extends UserContextTestCase { protected function getConfigFile(): string diff --git a/tests/Functional/Varnish/UserContextTestCase.php b/tests/Functional/Varnish/UserContextTestCase.php index ddfcff69..b71cddf3 100644 --- a/tests/Functional/Varnish/UserContextTestCase.php +++ b/tests/Functional/Varnish/UserContextTestCase.php @@ -12,10 +12,10 @@ namespace FOS\HttpCache\Tests\Functional\Varnish; use FOS\HttpCache\Test\VarnishTestCase; -use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes as PHPUnit; -#[Group('webserver')] -#[Group('varnish')] +#[PHPUnit\Group('webserver')] +#[PHPUnit\Group('varnish')] abstract class UserContextTestCase extends VarnishTestCase { /**