Skip to content

Commit 5105c68

Browse files
committed
[TASK] use PHP Attributes for functional tests
1 parent ecc9e50 commit 5105c68

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+381
-810
lines changed

Tests/Functional/Backend/Service/NewContentUriBuilderTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use B13\Container\Domain\Model\Container;
1818
use B13\Container\Domain\Service\ContainerService;
1919
use B13\Container\Tca\Registry;
20+
use PHPUnit\Framework\Attributes\Test;
2021
use TYPO3\CMS\Backend\Routing\UriBuilder;
2122
use TYPO3\CMS\Backend\View\PageLayoutContext;
2223
use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -28,9 +29,7 @@ class NewContentUriBuilderTest extends FunctionalTestCase
2829
'typo3conf/ext/container',
2930
];
3031

31-
/**
32-
* @test
33-
*/
32+
#[Test]
3433
public function getNewContentUrlAfterChildContainsUidOfLiveWorkspaceAsContainerParent(): void
3534
{
3635
$container = new Container(['uid' => 2, 't3ver_oid' => 1], []);
@@ -54,9 +53,7 @@ public function getNewContentUrlAfterChildContainsUidOfLiveWorkspaceAsContainerP
5453
self::assertStringContainsString('tx_container_parent=1', $newContentUrl, 'should container uid of live workspace record');
5554
}
5655

57-
/**
58-
* @test
59-
*/
56+
#[Test]
6057
public function getNewContentUrlAtTopOfColumnContainsUidOfLiveWorkspaceAsContainerParent(): void
6158
{
6259
$container = new Container(['uid' => 2, 't3ver_oid' => 1], []);
@@ -82,9 +79,7 @@ public function getNewContentUrlAtTopOfColumnContainsUidOfLiveWorkspaceAsContain
8279
self::assertStringContainsString('tx_container_parent=1', $newContentUrl, 'should container uid of live workspace record');
8380
}
8481

85-
/**
86-
* @test
87-
*/
82+
#[Test]
8883
public function getNewContentUrlAtTopOfColumnReturnsNullIfMaxitemsIsReached(): void
8984
{
9085
$container = new Container([], []);

Tests/Functional/Datahandler/ContentDefender/CopyContainerTest.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
* of the License, or any later version.
1313
*/
1414

15+
use PHPUnit\Framework\Attributes\Group;
16+
use PHPUnit\Framework\Attributes\Test;
17+
1518
class CopyContainerTest extends AbstractContentDefender
1619
{
1720
/**
@@ -29,10 +32,8 @@ protected function setUp(): void
2932
$this->importCSVDataSet(__DIR__ . '/Fixtures/copy_container.csv');
3033
}
3134

32-
/**
33-
* @test
34-
* @group content_defender
35-
*/
35+
#[Test]
36+
#[Group('content_defender')]
3637
public function copyContainerAfterElementCopiesChildEvenChildIsNotAllowedByContentDefenderInBackendLayout(): void
3738
{
3839
$cmdmap = [
@@ -54,10 +55,8 @@ public function copyContainerAfterElementCopiesChildEvenChildIsNotAllowedByConte
5455
self::assertCSVDataSet(__DIR__ . '/Fixtures/CopyContainerAfterElementCopiesChildEvenChildIsNotAllowedByContentDefenderInBackendLayoutResult.csv');
5556
}
5657

57-
/**
58-
* @test
59-
* @group content_defender
60-
*/
58+
#[Test]
59+
#[Group('content_defender')]
6160
public function copyContainerIntoOtherContainerWithSameColPosCopiesAlsoChildEvenChildIsDisallowedInTargetContainer(): void
6261
{
6362
$cmdmap = [
@@ -79,10 +78,8 @@ public function copyContainerIntoOtherContainerWithSameColPosCopiesAlsoChildEven
7978
self::assertCSVDataSet(__DIR__ . '/Fixtures/CopyContainerIntoOtherContainerWithSameColPosCopiesAlsoChildEvenChildIsDisallowedInTargetContainerResult.csv');
8079
}
8180

82-
/**
83-
* @test
84-
* @group content_defender
85-
*/
81+
#[Test]
82+
#[Group('content_defender')]
8683
public function copyContainerWithRestrictionsIgnoresContentDefender(): void
8784
{
8885
$this->importCSVDataSet(__DIR__ . '/Fixtures/copy_container_with_restrictions.csv');

Tests/Functional/Datahandler/ContentDefender/DefaultLanguageTest.php

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
* of the License, or any later version.
1313
*/
1414

15+
use PHPUnit\Framework\Attributes\Group;
16+
use PHPUnit\Framework\Attributes\Test;
17+
1518
class DefaultLanguageTest extends AbstractContentDefender
1619
{
1720
/**
@@ -29,10 +32,8 @@ protected function setUp(): void
2932
$this->importCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/setup.csv');
3033
}
3134

32-
/**
33-
* @test
34-
* @group content_defender
35-
*/
35+
#[Test]
36+
#[Group('content_defender')]
3637
public function moveElementIntoContainerAtTopDoNotMoveDisallowedCTypeElement(): void
3738
{
3839
$this->importCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/disallowed_content_element.csv');
@@ -58,10 +59,8 @@ public function moveElementIntoContainerAtTopDoNotMoveDisallowedCTypeElement():
5859
self::assertCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/MoveElementIntoContainerAtTopDoNotMoveDisallowedCTypeElementResult.csv');
5960
}
6061

61-
/**
62-
* @test
63-
* @group content_defender
64-
*/
62+
#[Test]
63+
#[Group('content_defender')]
6564
public function moveElementIntoContainerAfterOtherElemenDoNotMoveDisallowedCTypeElement(): void
6665
{
6766
$this->importCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/disallowed_content_element.csv');
@@ -87,10 +86,8 @@ public function moveElementIntoContainerAfterOtherElemenDoNotMoveDisallowedCType
8786
self::assertCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/MoveElementIntoContainerAfterOtherElemenDoNotMoveDisallowedCTypeElementResult.csv');
8887
}
8988

90-
/**
91-
* @test
92-
* @group content_defender
93-
*/
89+
#[Test]
90+
#[Group('content_defender')]
9491
public function copyElementIntoContainerAtTopDoNotCopyDisallowedCTypeElement(): void
9592
{
9693
$this->importCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/disallowed_content_element.csv');
@@ -116,10 +113,8 @@ public function copyElementIntoContainerAtTopDoNotCopyDisallowedCTypeElement():
116113
self::assertCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/CopyElementIntoContainerAtTopDoNotCopyDisallowedCTypeElementResult.csv');
117114
}
118115

119-
/**
120-
* @test
121-
* @group content_defender
122-
*/
116+
#[Test]
117+
#[Group('content_defender')]
123118
public function moveElementIntoContainerAtTopMoveAisallowedCTypeElement(): void
124119
{
125120
$this->importCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/allowed_content_element.csv');
@@ -145,10 +140,8 @@ public function moveElementIntoContainerAtTopMoveAisallowedCTypeElement(): void
145140
self::assertCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/MoveElementIntoContainerAtTopMoveAisallowedCTypeElementResult.csv');
146141
}
147142

148-
/**
149-
* @test
150-
* @group content_defender
151-
*/
143+
#[Test]
144+
#[Group('content_defender')]
152145
public function moveElementIntoContainerAfterOtherElemenMoveAllowedCTypeElement(): void
153146
{
154147
$this->importCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/allowed_content_element.csv');
@@ -174,10 +167,8 @@ public function moveElementIntoContainerAfterOtherElemenMoveAllowedCTypeElement(
174167
self::assertCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/MoveElementIntoContainerAfterOtherElemenMoveAllowedCTypeElementResult.csv');
175168
}
176169

177-
/**
178-
* @test
179-
* @group content_defender
180-
*/
170+
#[Test]
171+
#[Group('content_defender')]
181172
public function copyContentElementIntoContainerWhenCTypeIsNotAllowedInBackendLayoutColumn(): void
182173
{
183174
$this->importCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/CopyContentElementIntoContainerWhenCTypeIsNotAllowedInBackendLayoutColumn.csv');
@@ -205,10 +196,8 @@ public function copyContentElementIntoContainerWhenCTypeIsNotAllowedInBackendLay
205196
self::assertCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/CopyContentElementIntoContainerWhenCTypeIsNotAllowedInBackendLayoutColumnResult.csv');
206197
}
207198

208-
/**
209-
* @test
210-
* @group content_defender
211-
*/
199+
#[Test]
200+
#[Group('content_defender')]
212201
public function copyElementIntoContainerAtTopCopyAllowedCTypeElement(): void
213202
{
214203
$this->importCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/allowed_content_element.csv');
@@ -234,10 +223,8 @@ public function copyElementIntoContainerAtTopCopyAllowedCTypeElement(): void
234223
self::assertCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/CopyElementIntoContainerAtTopCopyAllowedCTypeElementResult.csv');
235224
}
236225

237-
/**
238-
* @test
239-
* @group content_defender
240-
*/
226+
#[Test]
227+
#[Group('content_defender')]
241228
public function copyChildFromOtherContainerIntoColposWhereTargetElementInOtherColposHasRestrictionIsAllowd(): void
242229
{
243230
$this->importCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/CopyChildFromOtherContainerIntoColposWhereTargetElementInOtherColposHasRestrictionIsAllowed.csv');

Tests/Functional/Datahandler/ContentDefender/LocalizationTest.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
* of the License, or any later version.
1313
*/
1414

15+
use PHPUnit\Framework\Attributes\Group;
16+
use PHPUnit\Framework\Attributes\Test;
17+
1518
class LocalizationTest extends AbstractContentDefender
1619
{
1720
/**
@@ -29,10 +32,8 @@ protected function setUp(): void
2932
$this->importCSVDataSet(__DIR__ . '/Fixtures/Localization/setup.csv');
3033
}
3134

32-
/**
33-
* @test
34-
* @group content_defender
35-
*/
35+
#[Test]
36+
#[Group('content_defender')]
3637
public function moveElementIntoContainerAtTopToNotMoveTranslationIfDisallowedCType(): void
3738
{
3839
$cmdmap = [
@@ -57,10 +58,8 @@ public function moveElementIntoContainerAtTopToNotMoveTranslationIfDisallowedCTy
5758
self::assertCSVDataSet(__DIR__ . '/Fixtures/Localization/MoveElementIntoContainerAtTopToNotMoveTranslationIfDisallowedCTypeResult.csv');
5859
}
5960

60-
/**
61-
* @test
62-
* @group content_defender
63-
*/
61+
#[Test]
62+
#[Group('content_defender')]
6463
public function copyElementIntoContainerAtTopDoNotCopyTranslationIfDisallowedCType(): void
6564
{
6665
$cmdmap = [

0 commit comments

Comments
 (0)