Skip to content

Commit 68148e1

Browse files
authored
use phpunit attributes (#562)
1 parent f803868 commit 68148e1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Test/Factories.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Zenstruck\Foundry\Test;
1313

14+
use PHPUnit\Framework\Attributes\After;
15+
use PHPUnit\Framework\Attributes\Before;
1416
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
1517
use Zenstruck\Foundry\ChainManagerRegistry;
1618
use Zenstruck\Foundry\Exception\FoundryBootException;
@@ -27,6 +29,7 @@ trait Factories
2729
* @internal
2830
* @before
2931
*/
32+
#[Before]
3033
public static function _setUpFactories(): void
3134
{
3235
if (!\is_subclass_of(static::class, KernelTestCase::class)) {
@@ -57,6 +60,7 @@ public static function _setUpFactories(): void
5760
* @internal
5861
* @after
5962
*/
63+
#[After]
6064
public static function _tearDownFactories(): void
6165
{
6266
try {

src/Test/ResetDatabase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace Zenstruck\Foundry\Test;
1313

1414
use DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticDriver;
15+
use PHPUnit\Framework\Attributes\Before;
16+
use PHPUnit\Framework\Attributes\BeforeClass;
1517
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
1618
use Symfony\Component\DependencyInjection\ContainerInterface;
1719
use Symfony\Component\HttpKernel\KernelInterface;
@@ -28,6 +30,7 @@ trait ResetDatabase
2830
* @internal
2931
* @beforeClass
3032
*/
33+
#[BeforeClass]
3134
public static function _resetDatabase(): void
3235
{
3336
if (!\is_subclass_of(static::class, KernelTestCase::class)) {
@@ -65,6 +68,7 @@ public static function _resetDatabase(): void
6568
* @internal
6669
* @before
6770
*/
71+
#[Before]
6872
public static function _resetSchema(): void
6973
{
7074
if (!\is_subclass_of(static::class, KernelTestCase::class)) {

0 commit comments

Comments
 (0)