Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

namespace the phpunit attributes for clarity #569

Merged
merged 1 commit into from Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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