Skip to content

Commit 1be50e0

Browse files
authored
Merge pull request #569 from FriendsOfSymfony/phpunit-attributes
namespace the phpunit attributes for clarity
2 parents f5ad06e + fe9876e commit 1be50e0

11 files changed

+31
-31
lines changed

doc/testing-your-application.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ use PHP’s built in web server. Include the WebServerSubscriber in your
5454
Then set the ``webserver`` group on your test to start PHP’s web server before
5555
it runs::
5656

57+
use PHPUnit\Framework\Attributes as PHPUnit;
58+
5759
class YourTest extends \PHPUnit_Framework_TestCase
5860
{
59-
/**
60-
* @group webserver
61-
*/
61+
#[PHPUnit\Group('webserver')]
6262
public function testYourApp()
6363
{
6464
// The web server will be started before this test code runs and

tests/Functional/CacheInvalidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
use FOS\HttpCache\CacheInvalidator;
1515
use FOS\HttpCache\Test\VarnishTestCase;
16-
use PHPUnit\Framework\Attributes\Group;
16+
use PHPUnit\Framework\Attributes as PHPUnit;
1717

18-
#[Group('webserver')]
18+
#[PHPUnit\Group('webserver')]
1919
class CacheInvalidatorTest extends VarnishTestCase
2020
{
2121
public function testInvalidateTags(): void

tests/Functional/ProxyClient/NginxProxyClientTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
namespace FOS\HttpCache\Tests\Functional\ProxyClient;
1313

1414
use FOS\HttpCache\Test\NginxTestCase;
15-
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes as PHPUnit;
1616

17-
#[Group('webserver')]
18-
#[Group('nginx')]
17+
#[PHPUnit\Group('webserver')]
18+
#[PHPUnit\Group('nginx')]
1919
class NginxProxyClientTest extends NginxTestCase
2020
{
2121
use PurgeAssertions;

tests/Functional/ProxyClient/SymfonyProxyClientTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
namespace FOS\HttpCache\Tests\Functional\ProxyClient;
1313

1414
use FOS\HttpCache\Test\SymfonyTestCase;
15-
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes as PHPUnit;
1616
use Toflar\Psr6HttpCacheStore\Psr6Store;
1717

18-
#[Group('webserver')]
19-
#[Group('symfony')]
18+
#[PHPUnit\Group('webserver')]
19+
#[PHPUnit\Group('symfony')]
2020
class SymfonyProxyClientTest extends SymfonyTestCase
2121
{
2222
use InvalidateTagsAssertions;

tests/Functional/ProxyClient/VarnishProxyClientTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
use FOS\HttpCache\ProxyClient\Varnish;
1515
use FOS\HttpCache\Test\VarnishTestCase;
16-
use PHPUnit\Framework\Attributes\Group;
16+
use PHPUnit\Framework\Attributes as PHPUnit;
1717

18-
#[Group('webserver')]
19-
#[Group('varnish')]
18+
#[PHPUnit\Group('webserver')]
19+
#[PHPUnit\Group('varnish')]
2020
class VarnishProxyClientTest extends VarnishTestCase
2121
{
2222
use BanAssertions;

tests/Functional/Symfony/EventDispatchingHttpCacheTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
use FOS\HttpCache\SymfonyCache\RefreshListener;
2121
use FOS\HttpCache\SymfonyCache\UserContextListener;
2222
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
23-
use PHPUnit\Framework\Attributes\Group;
23+
use PHPUnit\Framework\Attributes as PHPUnit;
2424
use PHPUnit\Framework\TestCase;
2525
use Symfony\Component\HttpFoundation\Request;
2626
use Symfony\Component\HttpFoundation\Response;
2727
use Symfony\Component\HttpKernel\HttpCache\HttpCache;
2828
use Symfony\Component\HttpKernel\HttpCache\StoreInterface;
2929
use Symfony\Component\HttpKernel\HttpKernelInterface;
3030

31-
#[Group('symfony')]
31+
#[PHPUnit\Group('symfony')]
3232
class EventDispatchingHttpCacheTest extends TestCase
3333
{
3434
use MockeryPHPUnitIntegration;

tests/Functional/Varnish/CustomTtlTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
namespace FOS\HttpCache\Tests\Functional\Varnish;
1313

1414
use FOS\HttpCache\Test\VarnishTestCase;
15-
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes as PHPUnit;
1616

17-
#[Group('webserver')]
18-
#[Group('varnish')]
17+
#[PHPUnit\Group('webserver')]
18+
#[PHPUnit\Group('varnish')]
1919
class CustomTtlTest extends VarnishTestCase
2020
{
2121
protected function getConfigFile(): string

tests/Functional/Varnish/UserContextCacheTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
namespace FOS\HttpCache\Tests\Functional\Varnish;
1313

14-
use PHPUnit\Framework\Attributes\Group;
14+
use PHPUnit\Framework\Attributes as PHPUnit;
1515

16-
#[Group('webserver')]
17-
#[Group('varnish')]
16+
#[PHPUnit\Group('webserver')]
17+
#[PHPUnit\Group('varnish')]
1818
class UserContextCacheTest extends UserContextTestCase
1919
{
2020
protected function getConfigFile(): string

tests/Functional/Varnish/UserContextFailureTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
namespace FOS\HttpCache\Tests\Functional\Varnish;
1313

1414
use FOS\HttpCache\Test\VarnishTestCase;
15-
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes as PHPUnit;
1616

17-
#[Group('webserver')]
18-
#[Group('varnish')]
17+
#[PHPUnit\Group('webserver')]
18+
#[PHPUnit\Group('varnish')]
1919
class UserContextFailureTest extends VarnishTestCase
2020
{
2121
/**

tests/Functional/Varnish/UserContextNocacheTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
namespace FOS\HttpCache\Tests\Functional\Varnish;
1313

14-
use PHPUnit\Framework\Attributes\Group;
14+
use PHPUnit\Framework\Attributes as PHPUnit;
1515

16-
#[Group('webserver')]
17-
#[Group('varnish')]
16+
#[PHPUnit\Group('webserver')]
17+
#[PHPUnit\Group('varnish')]
1818
class UserContextNocacheTest extends UserContextTestCase
1919
{
2020
protected function getConfigFile(): string

0 commit comments

Comments
 (0)