Skip to content

Commit 27cc7c3

Browse files
Stephan Wentzpl-github
authored andcommitted
fix: Use attributes for after and before
BREAKING CHANGE: The functional test helpers now require phpunit 10.x+
1 parent 0091853 commit 27cc7c3

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"phpstan/phpstan": "^1.2",
2727
"phpstan/phpstan-phpunit": "^1.0",
2828
"phpstan/phpstan-symfony": "^1.0",
29-
"phpunit/phpunit": "^10.1",
29+
"phpunit/phpunit": "^10.3",
3030
"riverline/multipart-parser": "^2.0",
3131
"slam/phpstan-extensions": "^6.0",
3232
"squizlabs/php_codesniffer": "^3.7.1",

src/Request/RequestTrait.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace Brainbits\FunctionalTestHelpers\Request;
66

7+
use PHPUnit\Framework\Attributes\After;
8+
use PHPUnit\Framework\Attributes\Before;
79
use PHPUnit\Framework\TestCase;
810
use Symfony\Component\BrowserKit\AbstractBrowser;
911
use Symfony\Component\BrowserKit\Cookie;
@@ -29,13 +31,13 @@ protected function createToken(): callable
2931
return static fn () => null;
3032
}
3133

32-
/** @before */
34+
#[Before]
3335
protected function setUpRequest(): void
3436
{
3537
self::$requestClient = static::createClient();
3638
}
3739

38-
/** @after */
40+
#[After]
3941
protected function tearDownRequest(): void
4042
{
4143
self::$requestClient = null;

src/Snapshot/SnapshotTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Brainbits\FunctionalTestHelpers\Snapshot;
66

77
use DOMDocument;
8+
use PHPUnit\Framework\Attributes\Before;
89
use PHPUnit\Framework\TestCase;
910
use Symfony\Component\Filesystem\Filesystem;
1011
use tidy;
@@ -40,7 +41,7 @@ trait SnapshotTrait
4041
/** @var array<string,int> */
4142
private array $filenames;
4243

43-
/** @before */
44+
#[Before]
4445
final protected function setUpSnapshot(): void
4546
{
4647
$this->filenames = [];

src/Uuid/UuidTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Brainbits\FunctionalTestHelpers\Uuid;
66

7+
use PHPUnit\Framework\Attributes\Before;
78
use PHPUnit\Framework\TestCase;
89
use Symfony\Component\Uid\NilUuid;
910
use Symfony\Component\Uid\Uuid;
@@ -21,7 +22,7 @@ trait UuidTrait
2122
{
2223
private int $lastUuidValue;
2324

24-
/** @before */
25+
#[Before]
2526
final protected function setUpUuidTrait(): void
2627
{
2728
$this->lastUuidValue = 0;

0 commit comments

Comments
 (0)