diff --git a/Tests/Functional/Hooks/DataHandlerHookTest.php b/Tests/Functional/Hooks/DataHandlerHookTest.php index 17fb7918..0eb2c59a 100644 --- a/Tests/Functional/Hooks/DataHandlerHookTest.php +++ b/Tests/Functional/Hooks/DataHandlerHookTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\Service; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Constants; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\DataHandling\DataHandler; @@ -37,9 +38,7 @@ protected function setUp(): void $GLOBALS['LANG'] = $this->get(LanguageServiceFactory::class)->createFromUserPreferences($backendUser); } - /** - * @test - */ + #[Test] public function create(): void { $this->importCSVDataSet(__DIR__ . '/Fixtures/BlogBasePages.csv'); @@ -86,9 +85,7 @@ public function create(): void self::assertEquals($page['crdate_year'], 2023); } - /** - * @test - */ + #[Test] public function update(): void { $this->importCSVDataSet(__DIR__ . '/Fixtures/BlogBasePages.csv'); diff --git a/Tests/Functional/Service/SetupServiceTest.php b/Tests/Functional/Service/SetupServiceTest.php index 9d9cdda8..3cfbb80b 100644 --- a/Tests/Functional/Service/SetupServiceTest.php +++ b/Tests/Functional/Service/SetupServiceTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\Service; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Constants; use T3G\AgencyPack\Blog\Service\SetupService; use TYPO3\CMS\Backend\Utility\BackendUtility; @@ -37,9 +38,7 @@ protected function setUp(): void $GLOBALS['LANG'] = $this->get(LanguageServiceFactory::class)->createFromUserPreferences($backendUser); } - /** - * @test - */ + #[Test] public function create(): void { $setupService = GeneralUtility::makeInstance(SetupService::class); @@ -52,9 +51,7 @@ public function create(): void self::assertEquals($rootPage['is_siteroot'], 1); } - /** - * @test - */ + #[Test] public function createWithName(): void { $setupService = GeneralUtility::makeInstance(SetupService::class); @@ -67,9 +64,7 @@ public function createWithName(): void self::assertEquals($rootPage['is_siteroot'], 1); } - /** - * @test - */ + #[Test] public function determineBlogSetups(): void { $setupService = GeneralUtility::makeInstance(SetupService::class); diff --git a/Tests/Functional/Updates/AuthorSlugUpdateTest.php b/Tests/Functional/Updates/AuthorSlugUpdateTest.php index 2f49e64c..89f8bf83 100644 --- a/Tests/Functional/Updates/AuthorSlugUpdateTest.php +++ b/Tests/Functional/Updates/AuthorSlugUpdateTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Updates\AuthorSlugUpdate; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -27,18 +28,14 @@ final class AuthorSlugUpdateTest extends FunctionalTestCase 'typo3conf/ext/blog' ]; - /** - * @test - */ + #[Test] public function noUpdateNecessaryTest(): void { $subject = new AuthorSlugUpdate(); self::assertFalse($subject->updateNecessary()); } - /** - * @test - */ + #[Test] public function updateTest(): void { $subject = new AuthorSlugUpdate(); diff --git a/Tests/Functional/Updates/AvatarProviderUpdateTest.php b/Tests/Functional/Updates/AvatarProviderUpdateTest.php index 92d74d2d..6ffe87e5 100644 --- a/Tests/Functional/Updates/AvatarProviderUpdateTest.php +++ b/Tests/Functional/Updates/AvatarProviderUpdateTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Updates\AvatarProviderUpdate; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -27,18 +28,14 @@ final class AvatarProviderUpdateTest extends FunctionalTestCase 'typo3conf/ext/blog' ]; - /** - * @test - */ + #[Test] public function noUpdateNecessaryTest(): void { $subject = new AvatarProviderUpdate(); self::assertFalse($subject->updateNecessary()); } - /** - * @test - */ + #[Test] public function updateTest(): void { $subject = new AvatarProviderUpdate(); diff --git a/Tests/Functional/Updates/CategorySlugUpdateTest.php b/Tests/Functional/Updates/CategorySlugUpdateTest.php index 179fa34f..0ad3b61d 100644 --- a/Tests/Functional/Updates/CategorySlugUpdateTest.php +++ b/Tests/Functional/Updates/CategorySlugUpdateTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Updates\CategorySlugUpdate; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -27,18 +28,14 @@ final class CategorySlugUpdateTest extends FunctionalTestCase 'typo3conf/ext/blog' ]; - /** - * @test - */ + #[Test] public function noUpdateNecessaryTest(): void { $subject = new CategorySlugUpdate(); self::assertFalse($subject->updateNecessary()); } - /** - * @test - */ + #[Test] public function updateTest(): void { $subject = new CategorySlugUpdate(); diff --git a/Tests/Functional/Updates/CategoryTypeUpdateTest.php b/Tests/Functional/Updates/CategoryTypeUpdateTest.php index ad79f8c1..c5e64bd0 100644 --- a/Tests/Functional/Updates/CategoryTypeUpdateTest.php +++ b/Tests/Functional/Updates/CategoryTypeUpdateTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Updates\CategoryTypeUpdate; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -27,18 +28,14 @@ final class CategoryTypeUpdateTest extends FunctionalTestCase 'typo3conf/ext/blog' ]; - /** - * @test - */ + #[Test] public function noUpdateNecessaryTest(): void { $subject = new CategoryTypeUpdate(); self::assertFalse($subject->updateNecessary()); } - /** - * @test - */ + #[Test] public function updateTest(): void { $subject = new CategoryTypeUpdate(); diff --git a/Tests/Functional/Updates/CommentStatusUpdateTest.php b/Tests/Functional/Updates/CommentStatusUpdateTest.php index 6220881a..8a5ba128 100644 --- a/Tests/Functional/Updates/CommentStatusUpdateTest.php +++ b/Tests/Functional/Updates/CommentStatusUpdateTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Updates\CommentStatusUpdate; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -27,18 +28,14 @@ final class CommentStatusUpdateTest extends FunctionalTestCase 'typo3conf/ext/blog' ]; - /** - * @test - */ + #[Test] public function noUpdateNecessaryTest(): void { $subject = new CommentStatusUpdate(); self::assertFalse($subject->updateNecessary()); } - /** - * @test - */ + #[Test] public function updateTest(): void { $subject = new CommentStatusUpdate(); diff --git a/Tests/Functional/Updates/DatabaseMonthYearUpdateTest.php b/Tests/Functional/Updates/DatabaseMonthYearUpdateTest.php index 1bcd16dc..abae2e91 100644 --- a/Tests/Functional/Updates/DatabaseMonthYearUpdateTest.php +++ b/Tests/Functional/Updates/DatabaseMonthYearUpdateTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Updates\DatabaseMonthYearUpdate; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -27,18 +28,14 @@ final class DatabaseMonthYearUpdateTest extends FunctionalTestCase 'typo3conf/ext/blog' ]; - /** - * @test - */ + #[Test] public function noUpdateNecessaryTest(): void { $subject = new DatabaseMonthYearUpdate(); self::assertFalse($subject->updateNecessary()); } - /** - * @test - */ + #[Test] public function updateTest(): void { $subject = new DatabaseMonthYearUpdate(); diff --git a/Tests/Functional/Updates/DatabasePublishDateUpdateTest.php b/Tests/Functional/Updates/DatabasePublishDateUpdateTest.php index 89339fc3..47c34add 100644 --- a/Tests/Functional/Updates/DatabasePublishDateUpdateTest.php +++ b/Tests/Functional/Updates/DatabasePublishDateUpdateTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Updates\DatabasePublishDateUpdate; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -27,18 +28,14 @@ final class DatabasePublishDateUpdateTest extends FunctionalTestCase 'typo3conf/ext/blog' ]; - /** - * @test - */ + #[Test] public function noUpdateNecessaryTest(): void { $subject = new DatabasePublishDateUpdate(); self::assertFalse($subject->updateNecessary()); } - /** - * @test - */ + #[Test] public function updateTest(): void { $subject = new DatabasePublishDateUpdate(); diff --git a/Tests/Functional/Updates/FeaturedImageUpdateTest.php b/Tests/Functional/Updates/FeaturedImageUpdateTest.php index 618335d8..2742bd23 100644 --- a/Tests/Functional/Updates/FeaturedImageUpdateTest.php +++ b/Tests/Functional/Updates/FeaturedImageUpdateTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Updates\FeaturedImageUpdate; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -27,18 +28,14 @@ final class FeaturedImageUpdateTest extends FunctionalTestCase 'typo3conf/ext/blog' ]; - /** - * @test - */ + #[Test] public function noUpdateNecessaryTest(): void { $subject = new FeaturedImageUpdate(); self::assertFalse($subject->updateNecessary()); } - /** - * @test - */ + #[Test] public function updateTest(): void { $subject = new FeaturedImageUpdate(); diff --git a/Tests/Functional/Updates/TagSlugUpdateTest.php b/Tests/Functional/Updates/TagSlugUpdateTest.php index 88abf940..8aa67a7c 100644 --- a/Tests/Functional/Updates/TagSlugUpdateTest.php +++ b/Tests/Functional/Updates/TagSlugUpdateTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Updates\TagSlugUpdate; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -27,18 +28,14 @@ final class TagSlugUpdateTest extends FunctionalTestCase 'typo3conf/ext/blog' ]; - /** - * @test - */ + #[Test] public function noUpdateNecessaryTest(): void { $subject = new TagSlugUpdate(); self::assertFalse($subject->updateNecessary()); } - /** - * @test - */ + #[Test] public function updateTest(): void { $subject = new TagSlugUpdate(); diff --git a/Tests/Functional/ViewHelpers/Data/ContentListOptionsViewHelperTest.php b/Tests/Functional/ViewHelpers/Data/ContentListOptionsViewHelperTest.php index f35ef3af..a2885858 100644 --- a/Tests/Functional/ViewHelpers/Data/ContentListOptionsViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Data/ContentListOptionsViewHelperTest.php @@ -11,6 +11,7 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Data; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Constants; use T3G\AgencyPack\Blog\Tests\Functional\SiteBasedTestCase; @@ -20,9 +21,7 @@ final class ContentListOptionsViewHelperTest extends SiteBasedTestCase 'form' ]; - /** - * @test - */ + #[Test] public function render(): void { $this->createTestSite(); @@ -45,9 +44,7 @@ public function render(): void ); } - /** - * @test - */ + #[Test] public function renderWithOverwrite(): void { $this->createTestSite(); diff --git a/Tests/Functional/ViewHelpers/GravatarViewHelperTest.php b/Tests/Functional/ViewHelpers/GravatarViewHelperTest.php index 73d8e038..a46b3b26 100644 --- a/Tests/Functional/ViewHelpers/GravatarViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/GravatarViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\ServerRequest; use TYPO3\CMS\Core\TypoScript\AST\Node\RootNode; @@ -30,10 +32,8 @@ final class GravatarViewHelperTest extends FunctionalTestCase 'typo3conf/ext/blog' ]; - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $frontendTypoScript = new FrontendTypoScript(new RootNode(), [], [], []); diff --git a/Tests/Functional/ViewHelpers/Link/ArchiveViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/ArchiveViewHelperTest.php index ff5d2662..7a09cbd0 100644 --- a/Tests/Functional/ViewHelpers/Link/ArchiveViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/ArchiveViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Link; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Constants; use T3G\AgencyPack\Blog\Tests\Functional\SiteBasedTestCase; use TYPO3\CMS\Core\Database\ConnectionPool; @@ -21,10 +23,8 @@ final class ArchiveViewHelperTest extends SiteBasedTestCase 'form' ]; - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $this->createTestSite(); diff --git a/Tests/Functional/ViewHelpers/Link/AuthorViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/AuthorViewHelperTest.php index e8ca8f36..6a8a39c5 100644 --- a/Tests/Functional/ViewHelpers/Link/AuthorViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/AuthorViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Link; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Tests\Functional\SiteBasedTestCase; use TYPO3\CMS\Core\Database\ConnectionPool; @@ -20,10 +22,8 @@ final class AuthorViewHelperTest extends SiteBasedTestCase 'form' ]; - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $this->createTestSite(); diff --git a/Tests/Functional/ViewHelpers/Link/Be/AuthorViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/Be/AuthorViewHelperTest.php index c1d90b43..9b329664 100644 --- a/Tests/Functional/ViewHelpers/Link/Be/AuthorViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/Be/AuthorViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Link\Be; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Domain\Model\Author; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\NormalizedParams; @@ -39,10 +41,8 @@ public function setUp(): void ->withAttribute('normalizedParams', new NormalizedParams([], [], '', '')); } - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $author = new Author(); diff --git a/Tests/Functional/ViewHelpers/Link/Be/CategoryViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/Be/CategoryViewHelperTest.php index 4be80620..223ef0ab 100644 --- a/Tests/Functional/ViewHelpers/Link/Be/CategoryViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/Be/CategoryViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Link\Be; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Domain\Model\Category; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\NormalizedParams; @@ -39,10 +41,8 @@ public function setUp(): void ->withAttribute('normalizedParams', new NormalizedParams([], [], '', '')); } - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $category = new Category(); diff --git a/Tests/Functional/ViewHelpers/Link/Be/CommentViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/Be/CommentViewHelperTest.php index 0bf5a969..2951b840 100644 --- a/Tests/Functional/ViewHelpers/Link/Be/CommentViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/Be/CommentViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Link\Be; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Domain\Model\Comment; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\NormalizedParams; @@ -39,10 +41,8 @@ public function setUp(): void ->withAttribute('normalizedParams', new NormalizedParams([], [], '', '')); } - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $comment = new Comment(); diff --git a/Tests/Functional/ViewHelpers/Link/Be/PostViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/Be/PostViewHelperTest.php index 45e880f9..1987e937 100644 --- a/Tests/Functional/ViewHelpers/Link/Be/PostViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/Be/PostViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Link\Be; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Domain\Model\Post; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\NormalizedParams; @@ -39,10 +41,8 @@ public function setUp(): void ->withAttribute('normalizedParams', new NormalizedParams([], [], '', '')); } - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $post = new Post(); diff --git a/Tests/Functional/ViewHelpers/Link/Be/TagViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/Be/TagViewHelperTest.php index 77c51218..e16dbe95 100644 --- a/Tests/Functional/ViewHelpers/Link/Be/TagViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/Be/TagViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Link\Be; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Domain\Model\Tag; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\NormalizedParams; @@ -39,10 +41,8 @@ public function setUp(): void ->withAttribute('normalizedParams', new NormalizedParams([], [], '', '')); } - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $tag = new Tag(); diff --git a/Tests/Functional/ViewHelpers/Link/CategoryViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/CategoryViewHelperTest.php index 673e4ad5..4a84b31e 100644 --- a/Tests/Functional/ViewHelpers/Link/CategoryViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/CategoryViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Link; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Constants; use T3G\AgencyPack\Blog\Tests\Functional\SiteBasedTestCase; use TYPO3\CMS\Core\Database\ConnectionPool; @@ -21,10 +23,8 @@ final class CategoryViewHelperTest extends SiteBasedTestCase 'form' ]; - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $this->createTestSite(); diff --git a/Tests/Functional/ViewHelpers/Link/PostViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/PostViewHelperTest.php index 3134aa7e..84dd5079 100644 --- a/Tests/Functional/ViewHelpers/Link/PostViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/PostViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Link; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Constants; use T3G\AgencyPack\Blog\Tests\Functional\SiteBasedTestCase; use TYPO3\CMS\Core\Database\ConnectionPool; @@ -21,10 +23,8 @@ final class PostViewHelperTest extends SiteBasedTestCase 'form' ]; - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $this->createTestSite(); diff --git a/Tests/Functional/ViewHelpers/Link/TagViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/TagViewHelperTest.php index c5188129..28095549 100644 --- a/Tests/Functional/ViewHelpers/Link/TagViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/TagViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Link; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Tests\Functional\SiteBasedTestCase; use TYPO3\CMS\Core\Database\ConnectionPool; @@ -20,10 +22,8 @@ final class TagViewHelperTest extends SiteBasedTestCase 'form' ]; - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $this->createTestSite(); diff --git a/Tests/Functional/ViewHelpers/Uri/AvatarViewHelperTest.php b/Tests/Functional/ViewHelpers/Uri/AvatarViewHelperTest.php index 16b8e4e5..1c00926d 100644 --- a/Tests/Functional/ViewHelpers/Uri/AvatarViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Uri/AvatarViewHelperTest.php @@ -11,6 +11,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional\ViewHelpers\Uri; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Domain\Model\Author; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\ServerRequest; @@ -31,10 +33,8 @@ final class AvatarViewHelperTest extends FunctionalTestCase 'typo3conf/ext/blog' ]; - /** - * @test - * @dataProvider renderDataProvider - */ + #[Test] + #[DataProvider('renderDataProvider')] public function render(string $template, string $expected): void { $frontendTypoScript = new FrontendTypoScript(new RootNode(), [], [], []); diff --git a/Tests/Unit/ConstantsTest.php b/Tests/Unit/ConstantsTest.php index e60cfa6f..fd236ed4 100644 --- a/Tests/Unit/ConstantsTest.php +++ b/Tests/Unit/ConstantsTest.php @@ -10,14 +10,13 @@ namespace T3G\AgencyPack\Blog\Tests\Unit; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Constants; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class ConstantsTest extends UnitTestCase { - /** - * @test - */ + #[Test] public function constantForDoktypeOfBlogPostsIsSetCorrectly(): void { self::assertEquals(137, Constants::DOKTYPE_BLOG_POST); diff --git a/Tests/Unit/Domain/Model/PostTest.php b/Tests/Unit/Domain/Model/PostTest.php index 248bc51c..d6e7b9cd 100644 --- a/Tests/Unit/Domain/Model/PostTest.php +++ b/Tests/Unit/Domain/Model/PostTest.php @@ -9,6 +9,7 @@ namespace T3G\AgencyPack\Blog\Tests\Unit\Domain\Model; +use PHPUnit\Framework\Attributes\Test; use T3G\AgencyPack\Blog\Constants; use T3G\AgencyPack\Blog\Domain\Model\Post; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; @@ -19,9 +20,7 @@ */ class PostTest extends UnitTestCase { - /** - * @test - */ + #[Test] public function doktypeEqualsConstant(): void { $post = new Post(); diff --git a/Tests/Unit/Service/CommentServiceTest.php b/Tests/Unit/Service/CommentServiceTest.php index 536f3c22..983c253f 100644 --- a/Tests/Unit/Service/CommentServiceTest.php +++ b/Tests/Unit/Service/CommentServiceTest.php @@ -10,6 +10,7 @@ namespace T3G\AgencyPack\Blog\Tests\Unit\Service; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\MockObject\MockObject; use T3G\AgencyPack\Blog\Domain\Model\Comment; use T3G\AgencyPack\Blog\Domain\Model\Post; @@ -42,9 +43,7 @@ public function initialize(): void ); } - /** - * @test - */ + #[Test] public function inactiveCommentsReturnErrorOnAdd(): void { $this->initialize(); @@ -57,9 +56,7 @@ public function inactiveCommentsReturnErrorOnAdd(): void self::assertSame(CommentService::STATE_ERROR, $result); } - /** - * @test - */ + #[Test] public function activeCommentsWithoutModerationReturnSuccessOnAdd(): void { $this->initialize(); @@ -75,9 +72,7 @@ public function activeCommentsWithoutModerationReturnSuccessOnAdd(): void self::assertSame(CommentService::STATE_SUCCESS, $result); } - /** - * @test - */ + #[Test] public function activeCommentsWithModerationReturnModerationOnAdd(): void { $this->initialize(); @@ -93,9 +88,7 @@ public function activeCommentsWithModerationReturnModerationOnAdd(): void self::assertSame(CommentService::STATE_MODERATION, $result); } - /** - * @test - */ + #[Test] public function commentGetsAddedToPost(): void { $this->initialize(); @@ -110,9 +103,7 @@ public function commentGetsAddedToPost(): void self::assertSame($comment, $post->getComments()->current()); } - /** - * @test - */ + #[Test] public function postGetsUpdatedInDatabase(): void { $this->initialize();