Skip to content

Commit

Permalink
Merge pull request #569 from FriendsOfSymfony/phpunit-attributes
Browse files Browse the repository at this point in the history
namespace the phpunit attributes for clarity
  • Loading branch information
dbu committed Mar 28, 2024
2 parents f5ad06e + fe9876e commit 1be50e0
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions doc/testing-your-application.rst
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/CacheInvalidatorTest.php
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/ProxyClient/NginxProxyClientTest.php
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/ProxyClient/SymfonyProxyClientTest.php
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/ProxyClient/VarnishProxyClientTest.php
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/Symfony/EventDispatchingHttpCacheTest.php
Expand Up @@ -20,15 +20,15 @@
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;
use Symfony\Component\HttpKernel\HttpCache\HttpCache;
use Symfony\Component\HttpKernel\HttpCache\StoreInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface;

#[Group('symfony')]
#[PHPUnit\Group('symfony')]
class EventDispatchingHttpCacheTest extends TestCase
{
use MockeryPHPUnitIntegration;
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/Varnish/CustomTtlTest.php
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/Varnish/UserContextCacheTest.php
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/Varnish/UserContextFailureTest.php
Expand Up @@ -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
{
/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/Varnish/UserContextNocacheTest.php
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/Varnish/UserContextTestCase.php
Expand Up @@ -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
{
/**
Expand Down

0 comments on commit 1be50e0

Please sign in to comment.