Skip to content

Commit 256330f

Browse files
committed
Fix tests and linter
1 parent 1960a91 commit 256330f

6 files changed

+31
-40
lines changed

api/tests/Api/Activities/CreateActivityTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ public function testCreateActivityInSharedCampIsAllowedForManager() {
133133
'end' => '2025-06-07T16:00:00+00:00',
134134
],
135135
],
136-
])]);
136+
])])
137+
;
137138

138139
$this->assertResponseStatusCodeSame(201);
139140
$this->assertJsonContains($this->getExampleReadPayload());

api/tests/Api/Camps/UpdateCampTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
namespace App\Tests\Api\Camps;
44

55
use App\Entity\Camp;
6-
use App\Entity\ContentNode\ChecklistNode;
76
use App\Tests\Api\ECampApiTestCase;
8-
use DateInterval;
9-
use DateTime;
107

118
/**
129
* @internal
@@ -600,13 +597,13 @@ public function testPatchCampEnablesSharedAndSetsMetadata() {
600597
$this->assertJsonContains([
601598
'isShared' => true,
602599
'_links' => [
603-
'sharedBy' => [ 'href' => $this->getIriFor('user1manager') ],
600+
'sharedBy' => ['href' => $this->getIriFor('user1manager')],
604601
],
605602
]);
606603
$camp = $this->getEntityManager()->getRepository(Camp::class)->find($camp->getId());
607604
$this->assertNotNull($camp->sharedSince);
608-
$shortlyAgo = new DateTime();
609-
$shortlyAgo->sub(new DateInterval('PT30S'));
605+
$shortlyAgo = new \DateTime();
606+
$shortlyAgo->sub(new \DateInterval('PT30S'));
610607
$this->assertGreaterThan($shortlyAgo, $camp->sharedSince);
611608
}
612609

@@ -617,14 +614,15 @@ public function testPatchCampDisablesSharedAndDoesNotChangeMetadata() {
617614
static::createClientWithCredentials(['email' => static::getFixture('user4unrelated')->getEmail()])
618615
->request('PATCH', '/camps/'.$camp->getId(), ['json' => [
619616
'isShared' => false,
620-
], 'headers' => ['Content-Type' => 'application/merge-patch+json']]);
617+
], 'headers' => ['Content-Type' => 'application/merge-patch+json']])
618+
;
621619

622620
$this->assertResponseStatusCodeSame(200);
623621
$this->assertJsonContains([
624622
'isShared' => false,
625623
'sharedSince' => '2025-09-03T12:00:00+00:00',
626624
'_links' => [
627-
'sharedBy' => [ 'href' => $this->getIriFor('admin') ],
625+
'sharedBy' => ['href' => $this->getIriFor('admin')],
628626
],
629627
]);
630628
}

api/tests/Api/Comments/ListCommentsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testListCommentsSortyByCreateTime() {
5858
$response = $client->request('GET', '/comments');
5959
$items = $response->toArray()['_embedded']['items'];
6060

61-
$this->assertCount(4, $items);
61+
$this->assertCount(6, $items);
6262
$this->assertGreaterThanOrEqual($items[0]['createTime'], $items[3]['createTime']);
6363
$this->assertEquals($items[3]['createTime'], $lastComment['createTime']);
6464
}

api/tests/Api/SnapshotTests/__snapshots__/ResponseSnapshotTest__testGetCollectionMatchesStructure with data set activities__1.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@
345345
"category": {
346346
"href": "escaped_value"
347347
},
348+
"comments": {
349+
"href": "escaped_value"
350+
},
348351
"contentNodes": {
349352
"href": "escaped_value"
350353
},

api/tests/Api/SnapshotTests/__snapshots__/ResponseSnapshotTest__testGetCollectionMatchesStructure with data set comments__1.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"href": "escaped_value"
7777
}
7878
},
79+
"createTime": "escaped_value",
7980
"id": "escaped_value",
8081
"orphanDescription": "escaped_value",
8182
"textHtml": "escaped_value"
@@ -95,6 +96,7 @@
9596
"href": "escaped_value"
9697
}
9798
},
99+
"createTime": "escaped_value",
98100
"id": "escaped_value",
99101
"orphanDescription": "escaped_value",
100102
"textHtml": "escaped_value"

api/tests/Api/SnapshotTests/__snapshots__/ResponseSnapshotTest__testOpenApiSpecMatchesSnapshot__1.yml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,7 +2499,7 @@ components:
24992499
isShared:
25002500
default: false
25012501
description: |-
2502-
Whether the programme of this camp is publicly available to anyone (except for
2502+
Whether the programme of this camp is publicly available to anyone (including
25032503
personal data such as camp collaborations, personal material lists,
25042504
responsibilities and comments).
25052505
example: true
@@ -2616,7 +2616,6 @@ components:
26162616
- periods
26172617
- printYSLogoOnPicasso
26182618
- progressLabels
2619-
- sharedSince
26202619
- title
26212620
type: object
26222621
Camp-read_Camp.Periods_Period.Days_Camp.CampCollaborations_CampCollaboration.User:
@@ -2725,7 +2724,7 @@ components:
27252724
isShared:
27262725
default: false
27272726
description: |-
2728-
Whether the programme of this camp is publicly available to anyone (except for
2727+
Whether the programme of this camp is publicly available to anyone (including
27292728
personal data such as camp collaborations, personal material lists,
27302729
responsibilities and comments).
27312730
example: true
@@ -2835,7 +2834,6 @@ components:
28352834
- periods
28362835
- printYSLogoOnPicasso
28372836
- progressLabels
2838-
- sharedSince
28392837
- title
28402838
type: object
28412839
Camp-read_CampCollaboration.Camp_CampCollaboration.User:
@@ -2940,7 +2938,7 @@ components:
29402938
isShared:
29412939
default: false
29422940
description: |-
2943-
Whether the programme of this camp is publicly available to anyone (except for
2941+
Whether the programme of this camp is publicly available to anyone (including
29442942
personal data such as camp collaborations, personal material lists,
29452943
responsibilities and comments).
29462944
example: true
@@ -3057,7 +3055,6 @@ components:
30573055
- periods
30583056
- printYSLogoOnPicasso
30593057
- progressLabels
3060-
- sharedSince
30613058
- title
30623059
type: object
30633060
Camp-read_Period.Camp_Period.Days:
@@ -3162,7 +3159,7 @@ components:
31623159
isShared:
31633160
default: false
31643161
description: |-
3165-
Whether the programme of this camp is publicly available to anyone (except for
3162+
Whether the programme of this camp is publicly available to anyone (including
31663163
personal data such as camp collaborations, personal material lists,
31673164
responsibilities and comments).
31683165
example: true
@@ -3279,7 +3276,6 @@ components:
32793276
- periods
32803277
- printYSLogoOnPicasso
32813278
- progressLabels
3282-
- sharedSince
32833279
- title
32843280
type: object
32853281
Camp-write_create:
@@ -3348,7 +3344,7 @@ components:
33483344
isShared:
33493345
default: false
33503346
description: |-
3351-
Whether the programme of this camp is publicly available to anyone (except for
3347+
Whether the programme of this camp is publicly available to anyone (including
33523348
personal data such as camp collaborations, personal material lists,
33533349
responsibilities and comments).
33543350
example: true
@@ -3477,7 +3473,7 @@ components:
34773473
isShared:
34783474
default: false
34793475
description: |-
3480-
Whether the programme of this camp is publicly available to anyone (except for
3476+
Whether the programme of this camp is publicly available to anyone (including
34813477
personal data such as camp collaborations, personal material lists,
34823478
responsibilities and comments).
34833479
example: true
@@ -3604,7 +3600,7 @@ components:
36043600
isShared:
36053601
default: false
36063602
description: |-
3607-
Whether the programme of this camp is publicly available to anyone (except for
3603+
Whether the programme of this camp is publicly available to anyone (including
36083604
personal data such as camp collaborations, personal material lists,
36093605
responsibilities and comments).
36103606
example: true
@@ -3657,7 +3653,6 @@ components:
36573653
type: ['null', string]
36583654
required:
36593655
- printYSLogoOnPicasso
3660-
- sharedSince
36613656
- title
36623657
type: object
36633658
id:
@@ -3851,7 +3846,7 @@ components:
38513846
isShared:
38523847
default: false
38533848
description: |-
3854-
Whether the programme of this camp is publicly available to anyone (except for
3849+
Whether the programme of this camp is publicly available to anyone (including
38553850
personal data such as camp collaborations, personal material lists,
38563851
responsibilities and comments).
38573852
example: true
@@ -3968,7 +3963,6 @@ components:
39683963
- periods
39693964
- printYSLogoOnPicasso
39703965
- progressLabels
3971-
- sharedSince
39723966
- title
39733967
type: object
39743968
Camp.jsonhal-read_Camp.Periods_Period.Days_Camp.CampCollaborations_CampCollaboration.User:
@@ -4086,7 +4080,7 @@ components:
40864080
isShared:
40874081
default: false
40884082
description: |-
4089-
Whether the programme of this camp is publicly available to anyone (except for
4083+
Whether the programme of this camp is publicly available to anyone (including
40904084
personal data such as camp collaborations, personal material lists,
40914085
responsibilities and comments).
40924086
example: true
@@ -4196,7 +4190,6 @@ components:
41964190
- periods
41974191
- printYSLogoOnPicasso
41984192
- progressLabels
4199-
- sharedSince
42004193
- title
42014194
type: object
42024195
Camp.jsonhal-read_CampCollaboration.Camp_CampCollaboration.User:
@@ -4310,7 +4303,7 @@ components:
43104303
isShared:
43114304
default: false
43124305
description: |-
4313-
Whether the programme of this camp is publicly available to anyone (except for
4306+
Whether the programme of this camp is publicly available to anyone (including
43144307
personal data such as camp collaborations, personal material lists,
43154308
responsibilities and comments).
43164309
example: true
@@ -4427,7 +4420,6 @@ components:
44274420
- periods
44284421
- printYSLogoOnPicasso
44294422
- progressLabels
4430-
- sharedSince
44314423
- title
44324424
type: object
44334425
Camp.jsonhal-read_Period.Camp_Period.Days:
@@ -4541,7 +4533,7 @@ components:
45414533
isShared:
45424534
default: false
45434535
description: |-
4544-
Whether the programme of this camp is publicly available to anyone (except for
4536+
Whether the programme of this camp is publicly available to anyone (including
45454537
personal data such as camp collaborations, personal material lists,
45464538
responsibilities and comments).
45474539
example: true
@@ -4658,7 +4650,6 @@ components:
46584650
- periods
46594651
- printYSLogoOnPicasso
46604652
- progressLabels
4661-
- sharedSince
46624653
- title
46634654
type: object
46644655
Camp.jsonhal-write_create:
@@ -4736,7 +4727,7 @@ components:
47364727
isShared:
47374728
default: false
47384729
description: |-
4739-
Whether the programme of this camp is publicly available to anyone (except for
4730+
Whether the programme of this camp is publicly available to anyone (including
47404731
personal data such as camp collaborations, personal material lists,
47414732
responsibilities and comments).
47424733
example: true
@@ -4934,7 +4925,7 @@ components:
49344925
isShared:
49354926
default: false
49364927
description: |-
4937-
Whether the programme of this camp is publicly available to anyone (except for
4928+
Whether the programme of this camp is publicly available to anyone (including
49384929
personal data such as camp collaborations, personal material lists,
49394930
responsibilities and comments).
49404931
example: true
@@ -5051,7 +5042,6 @@ components:
50515042
- periods
50525043
- printYSLogoOnPicasso
50535044
- progressLabels
5054-
- sharedSince
50555045
- title
50565046
type: object
50575047
Camp.jsonld-read_Camp.Periods_Period.Days_Camp.CampCollaborations_CampCollaboration.User:
@@ -5183,7 +5173,7 @@ components:
51835173
isShared:
51845174
default: false
51855175
description: |-
5186-
Whether the programme of this camp is publicly available to anyone (except for
5176+
Whether the programme of this camp is publicly available to anyone (including
51875177
personal data such as camp collaborations, personal material lists,
51885178
responsibilities and comments).
51895179
example: true
@@ -5293,7 +5283,6 @@ components:
52935283
- periods
52945284
- printYSLogoOnPicasso
52955285
- progressLabels
5296-
- sharedSince
52975286
- title
52985287
type: object
52995288
Camp.jsonld-read_CampCollaboration.Camp_CampCollaboration.User:
@@ -5421,7 +5410,7 @@ components:
54215410
isShared:
54225411
default: false
54235412
description: |-
5424-
Whether the programme of this camp is publicly available to anyone (except for
5413+
Whether the programme of this camp is publicly available to anyone (including
54255414
personal data such as camp collaborations, personal material lists,
54265415
responsibilities and comments).
54275416
example: true
@@ -5538,7 +5527,6 @@ components:
55385527
- periods
55395528
- printYSLogoOnPicasso
55405529
- progressLabels
5541-
- sharedSince
55425530
- title
55435531
type: object
55445532
Camp.jsonld-read_Period.Camp_Period.Days:
@@ -5666,7 +5654,7 @@ components:
56665654
isShared:
56675655
default: false
56685656
description: |-
5669-
Whether the programme of this camp is publicly available to anyone (except for
5657+
Whether the programme of this camp is publicly available to anyone (including
56705658
personal data such as camp collaborations, personal material lists,
56715659
responsibilities and comments).
56725660
example: true
@@ -5783,7 +5771,6 @@ components:
57835771
- periods
57845772
- printYSLogoOnPicasso
57855773
- progressLabels
5786-
- sharedSince
57875774
- title
57885775
type: object
57895776
Camp.jsonld-write_create:
@@ -5852,7 +5839,7 @@ components:
58525839
isShared:
58535840
default: false
58545841
description: |-
5855-
Whether the programme of this camp is publicly available to anyone (except for
5842+
Whether the programme of this camp is publicly available to anyone (including
58565843
personal data such as camp collaborations, personal material lists,
58575844
responsibilities and comments).
58585845
example: true

0 commit comments

Comments
 (0)