Skip to content

Commit 62c1af4

Browse files
committed
Apply Attributes via Rector
1 parent 894245b commit 62c1af4

8 files changed

Lines changed: 74 additions & 75 deletions

File tree

ci/qa/rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
])
1414
// uncomment to reach your current PHP version
1515
// ->withPhpSets()
16-
// ->withAttributesSets(all: true)
16+
->withAttributesSets(all: true)
1717
->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true)
1818
// ->withTypeCoverageLevel(0)
1919
// ->withDeadCodeLevel(0)

src/Surfnet/StepupRa/RaBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ final class ConfigurationTest extends TestCase
2828

2929
/**
3030
* @test
31-
* @group configuration
3231
*/
32+
#[\PHPUnit\Framework\Attributes\Group('configuration')]
3333
public function it_requires_second_factors_to_be_configured()
3434
{
3535
$configuration = [
@@ -44,8 +44,8 @@ public function it_requires_second_factors_to_be_configured()
4444

4545
/**
4646
* @test
47-
* @group configuration
4847
*/
48+
#[\PHPUnit\Framework\Attributes\Group('configuration')]
4949
public function it_requires_session_timeout_configuration()
5050
{
5151
$configuration = ['enabled_second_factors' => ['sms']];
@@ -55,8 +55,8 @@ public function it_requires_session_timeout_configuration()
5555

5656
/**
5757
* @test
58-
* @group configuration
5958
*/
59+
#[\PHPUnit\Framework\Attributes\Group('configuration')]
6060
public function it_requires_maximum_absolute_timeout_to_be_configured()
6161
{
6262
$configuration = [
@@ -69,8 +69,8 @@ public function it_requires_maximum_absolute_timeout_to_be_configured()
6969

7070
/**
7171
* @test
72-
* @group configuration
7372
*/
73+
#[\PHPUnit\Framework\Attributes\Group('configuration')]
7474
public function it_requires_maximum_relative_timeout_to_be_configured()
7575
{
7676
$configuration = [
@@ -83,17 +83,17 @@ public function it_requires_maximum_relative_timeout_to_be_configured()
8383

8484
/**
8585
* @test
86-
* @group configuration
8786
*/
87+
#[\PHPUnit\Framework\Attributes\Group('configuration')]
8888
public function it_allows_one_enabled_second_factor()
8989
{
9090
$this->assertConfigurationIsValid([['enabled_second_factors' => ['sms']]], 'enabled_second_factors');
9191
}
9292

9393
/**
9494
* @test
95-
* @group configuration
9695
*/
96+
#[\PHPUnit\Framework\Attributes\Group('configuration')]
9797
public function it_allows_two_enabled_second_factors()
9898
{
9999
$this->assertConfigurationIsValid([['enabled_second_factors' => ['sms', 'yubikey']]], 'enabled_second_factors');

src/Surfnet/StepupRa/RaBundle/Tests/Security/Session/SessionLifetimeGuardTest.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public function tearDown(): void
3939

4040
/**
4141
* @test
42-
* @group security
43-
* @group session
4442
*/
43+
#[\PHPUnit\Framework\Attributes\Group('security')]
44+
#[\PHPUnit\Framework\Attributes\Group('session')]
4545
public function an_authentication_session_without_logged_authentication_is_within_absolute_limit()
4646
{
4747
$sessionLifetimeGuard = new SessionLifetimeGuard(TimeFrame::ofSeconds(1000), TimeFrame::ofSeconds(100));
@@ -53,9 +53,9 @@ public function an_authentication_session_without_logged_authentication_is_withi
5353

5454
/**
5555
* @test
56-
* @group security
57-
* @group session
5856
*/
57+
#[\PHPUnit\Framework\Attributes\Group('security')]
58+
#[\PHPUnit\Framework\Attributes\Group('session')]
5959
public function an_authentication_session_without_logged_authentication_is_within_relative_limit()
6060
{
6161
$sessionLifetimeGuard = new SessionLifetimeGuard(TimeFrame::ofSeconds(1000), TimeFrame::ofSeconds(100));
@@ -67,9 +67,9 @@ public function an_authentication_session_without_logged_authentication_is_withi
6767

6868
/**
6969
* @test
70-
* @group security
71-
* @group session
7270
*/
71+
#[\PHPUnit\Framework\Attributes\Group('security')]
72+
#[\PHPUnit\Framework\Attributes\Group('session')]
7373
public function an_authentication_session_without_logged_authentication_is_within_limits()
7474
{
7575
$sessionLifetimeGuard = new SessionLifetimeGuard(TimeFrame::ofSeconds(1000), TimeFrame::ofSeconds(100));
@@ -81,9 +81,9 @@ public function an_authentication_session_without_logged_authentication_is_withi
8181

8282
/**
8383
* @test
84-
* @group security
85-
* @group session
8684
*/
85+
#[\PHPUnit\Framework\Attributes\Group('security')]
86+
#[\PHPUnit\Framework\Attributes\Group('session')]
8787
public function an_authentication_session_with_a_lifetime_within_the_absolute_timeframe_is_within_the_absolute_limit()
8888
{
8989
$sessionLifetimeGuard = new SessionLifetimeGuard(TimeFrame::ofSeconds(1000), TimeFrame::ofSeconds(1));
@@ -97,9 +97,9 @@ public function an_authentication_session_with_a_lifetime_within_the_absolute_ti
9797

9898
/**
9999
* @test
100-
* @group security
101-
* @group session
102100
*/
101+
#[\PHPUnit\Framework\Attributes\Group('security')]
102+
#[\PHPUnit\Framework\Attributes\Group('session')]
103103
public function an_authentication_session_with_a_lifetime_of_exactly_the_absolute_timeframe_is_within_the_absolute_limit()
104104
{
105105
$sessionLifetimeGuard = new SessionLifetimeGuard(TimeFrame::ofSeconds(1000), TimeFrame::ofSeconds(1));
@@ -113,9 +113,9 @@ public function an_authentication_session_with_a_lifetime_of_exactly_the_absolut
113113

114114
/**
115115
* @test
116-
* @group security
117-
* @group session
118116
*/
117+
#[\PHPUnit\Framework\Attributes\Group('security')]
118+
#[\PHPUnit\Framework\Attributes\Group('session')]
119119
public function an_authentication_session_with_a_lifetime_longer_than_the_absolute_timeframe_is_outside_the_absolute_limit()
120120
{
121121
$sessionLifetimeGuard = new SessionLifetimeGuard(TimeFrame::ofSeconds(1000), TimeFrame::ofSeconds(1));
@@ -129,9 +129,9 @@ public function an_authentication_session_with_a_lifetime_longer_than_the_absolu
129129

130130
/**
131131
* @test
132-
* @group security
133-
* @group session
134132
*/
133+
#[\PHPUnit\Framework\Attributes\Group('security')]
134+
#[\PHPUnit\Framework\Attributes\Group('session')]
135135
public function an_authentication_session_with_an_interaction_within_the_relative_timeframe_is_within_the_relative_limit()
136136
{
137137
$sessionLifetimeGuard = new SessionLifetimeGuard(TimeFrame::ofSeconds(1), TimeFrame::ofSeconds(1000));
@@ -145,9 +145,9 @@ public function an_authentication_session_with_an_interaction_within_the_relativ
145145

146146
/**
147147
* @test
148-
* @group security
149-
* @group session
150148
*/
149+
#[\PHPUnit\Framework\Attributes\Group('security')]
150+
#[\PHPUnit\Framework\Attributes\Group('session')]
151151
public function an_authentication_session_with_an_interaction_after_exactly_the_relative_timeframe_is_within_the_relative_limit()
152152
{
153153
$sessionLifetimeGuard = new SessionLifetimeGuard(TimeFrame::ofSeconds(1), TimeFrame::ofSeconds(1000));
@@ -161,9 +161,9 @@ public function an_authentication_session_with_an_interaction_after_exactly_the_
161161

162162
/**
163163
* @test
164-
* @group security
165-
* @group session
166164
*/
165+
#[\PHPUnit\Framework\Attributes\Group('security')]
166+
#[\PHPUnit\Framework\Attributes\Group('session')]
167167
public function an_authentication_session_with_an_interaction_after_the_relative_timeframe_is_outside_the_relative_limit()
168168
{
169169
$sessionLifetimeGuard = new SessionLifetimeGuard(TimeFrame::ofSeconds(1000), TimeFrame::ofSeconds(1));
@@ -177,14 +177,14 @@ public function an_authentication_session_with_an_interaction_after_the_relative
177177

178178
/**
179179
* @test
180-
* @group security
181-
* @group session
182180
* @dataProvider bothLimitsVerificationProvider
183181
*
184182
* @param bool $isValid
185183
* @param null|DateTime $authenticationMoment
186184
* @param null|DateTime $interactionMoment
187185
*/
186+
#[\PHPUnit\Framework\Attributes\Group('security')]
187+
#[\PHPUnit\Framework\Attributes\Group('session')]
188188
public function an_authentication_session_is_verified_against_both_limits(
189189
$isValid,
190190
DateTime $authenticationMoment = null,

src/Surfnet/StepupRa/RaBundle/Tests/Security/Session/SessionStorageTest.php

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public function tearDown(): void
3939

4040
/**
4141
* @test
42-
* @group security
43-
* @group session
4442
*/
43+
#[\PHPUnit\Framework\Attributes\Group('security')]
44+
#[\PHPUnit\Framework\Attributes\Group('session')]
4545
public function the_authentication_moment_can_be_logged()
4646
{
4747
$fakeRequestStack = new FakeRequestStack();
@@ -54,9 +54,9 @@ public function the_authentication_moment_can_be_logged()
5454

5555
/**
5656
* @test
57-
* @group security
58-
* @group session
5957
*/
58+
#[\PHPUnit\Framework\Attributes\Group('security')]
59+
#[\PHPUnit\Framework\Attributes\Group('session')]
6060
public function the_authentication_moment_cannot_be_logged_twice()
6161
{
6262
$this->expectException(LogicException::class);
@@ -69,9 +69,9 @@ public function the_authentication_moment_cannot_be_logged_twice()
6969

7070
/**
7171
* @test
72-
* @group security
73-
* @group session
7472
*/
73+
#[\PHPUnit\Framework\Attributes\Group('security')]
74+
#[\PHPUnit\Framework\Attributes\Group('session')]
7575
public function whether_or_not_an_authentication_moment_is_logged_can_be_queried()
7676
{
7777
$fakeRequestStack = new FakeRequestStack();
@@ -86,9 +86,9 @@ public function whether_or_not_an_authentication_moment_is_logged_can_be_queried
8686

8787
/**
8888
* @test
89-
* @group security
90-
* @group session
9189
*/
90+
#[\PHPUnit\Framework\Attributes\Group('security')]
91+
#[\PHPUnit\Framework\Attributes\Group('session')]
9292
public function a_logged_authentication_moment_can_be_retrieved()
9393
{
9494
$fakeRequestStack = new FakeRequestStack();
@@ -105,9 +105,9 @@ public function a_logged_authentication_moment_can_be_retrieved()
105105

106106
/**
107107
* @test
108-
* @group security
109-
* @group session
110108
*/
109+
#[\PHPUnit\Framework\Attributes\Group('security')]
110+
#[\PHPUnit\Framework\Attributes\Group('session')]
111111
public function attempting_to_retrieve_an_authentication_moment_when_not_yet_logged_causes_an_exception_to_be_thrown()
112112
{
113113
$this->expectException(LogicException::class);
@@ -120,9 +120,9 @@ public function attempting_to_retrieve_an_authentication_moment_when_not_yet_log
120120

121121
/**
122122
* @test
123-
* @group security
124-
* @group session
125123
*/
124+
#[\PHPUnit\Framework\Attributes\Group('security')]
125+
#[\PHPUnit\Framework\Attributes\Group('session')]
126126
public function an_interaction_can_be_logged()
127127
{
128128
$fakeRequestStack = new FakeRequestStack();
@@ -135,9 +135,9 @@ public function an_interaction_can_be_logged()
135135

136136
/**
137137
* @test
138-
* @group security
139-
* @group session
140138
*/
139+
#[\PHPUnit\Framework\Attributes\Group('security')]
140+
#[\PHPUnit\Framework\Attributes\Group('session')]
141141
public function the_moment_of_interaction_can_be_retrieved()
142142
{
143143
$fakeRequestStack = new FakeRequestStack();
@@ -154,9 +154,9 @@ public function the_moment_of_interaction_can_be_retrieved()
154154

155155
/**
156156
* @test
157-
* @group security
158-
* @group session
159157
*/
158+
#[\PHPUnit\Framework\Attributes\Group('security')]
159+
#[\PHPUnit\Framework\Attributes\Group('session')]
160160
public function an_interaction_is_logged_when_an_authentication_is_logged()
161161
{
162162
$fakeRequestStack = new FakeRequestStack();
@@ -179,9 +179,9 @@ public function an_interaction_is_logged_when_an_authentication_is_logged()
179179

180180
/**
181181
* @test
182-
* @group security
183-
* @group session
184182
*/
183+
#[\PHPUnit\Framework\Attributes\Group('security')]
184+
#[\PHPUnit\Framework\Attributes\Group('session')]
185185
public function the_moment_of_interaction_can_be_updated()
186186
{
187187
$fakeRequestStack = new FakeRequestStack();
@@ -206,9 +206,9 @@ public function the_moment_of_interaction_can_be_updated()
206206

207207
/**
208208
* @test
209-
* @group security
210-
* @group session
211209
*/
210+
#[\PHPUnit\Framework\Attributes\Group('security')]
211+
#[\PHPUnit\Framework\Attributes\Group('session')]
212212
public function the_existence_of_a_moment_interaction_can_be_queried()
213213
{
214214
$fakeRequestStack = new FakeRequestStack();
@@ -223,9 +223,9 @@ public function the_existence_of_a_moment_interaction_can_be_queried()
223223

224224
/**
225225
* @test
226-
* @group security
227-
* @group session
228226
*/
227+
#[\PHPUnit\Framework\Attributes\Group('security')]
228+
#[\PHPUnit\Framework\Attributes\Group('session')]
229229
public function the_current_uri_can_be_stored_in_the_session()
230230
{
231231
$fakeRequestStack = new FakeRequestStack();
@@ -240,9 +240,9 @@ public function the_current_uri_can_be_stored_in_the_session()
240240

241241
/**
242242
* @test
243-
* @group security
244-
* @group session
245243
*/
244+
#[\PHPUnit\Framework\Attributes\Group('security')]
245+
#[\PHPUnit\Framework\Attributes\Group('session')]
246246
public function a_request_id_can_be_stored_in_the_session()
247247
{
248248
$fakeRequestStack = new FakeRequestStack();
@@ -257,9 +257,9 @@ public function a_request_id_can_be_stored_in_the_session()
257257

258258
/**
259259
* @test
260-
* @group security
261-
* @group session
262260
*/
261+
#[\PHPUnit\Framework\Attributes\Group('security')]
262+
#[\PHPUnit\Framework\Attributes\Group('session')]
263263
public function the_presence_of_a_request_id_can_be_queried()
264264
{
265265
$fakeRequestStack = new FakeRequestStack();
@@ -275,9 +275,9 @@ public function the_presence_of_a_request_id_can_be_queried()
275275

276276
/**
277277
* @test
278-
* @group security
279-
* @group session
280278
*/
279+
#[\PHPUnit\Framework\Attributes\Group('security')]
280+
#[\PHPUnit\Framework\Attributes\Group('session')]
281281
public function a_stored_request_id_can_be_cleared()
282282
{
283283
$fakeRequestStack = new FakeRequestStack();
@@ -298,9 +298,9 @@ public function a_stored_request_id_can_be_cleared()
298298

299299
/**
300300
* @test
301-
* @group security
302-
* @group session
303301
*/
302+
#[\PHPUnit\Framework\Attributes\Group('security')]
303+
#[\PHPUnit\Framework\Attributes\Group('session')]
304304
public function a_session_can_be_invalidated()
305305
{
306306
$session = Mockery::mock(SessionInterface::class)
@@ -317,9 +317,9 @@ public function a_session_can_be_invalidated()
317317

318318
/**
319319
* @test
320-
* @group security
321-
* @group session
322320
*/
321+
#[\PHPUnit\Framework\Attributes\Group('security')]
322+
#[\PHPUnit\Framework\Attributes\Group('session')]
323323
public function a_session_can_be_migrated()
324324
{
325325
$session = Mockery::mock(SessionInterface::class)

0 commit comments

Comments
 (0)