File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,9 +73,9 @@ public function testWithData(): void
7373 $ this ->assertOk ($ response ); // 1: - viewed album4
7474 $ response = $ this ->get ('gallery/ ' . $ this ->album4 ->id );
7575 $ this ->assertOk ($ response ); // 2: - shared album4
76- $ response = $ this ->postJson ('Metrics::photo ' , ['photo_ids ' => [$ this ->photo4 ->id ]]);
76+ $ response = $ this ->postJson ('Metrics::photo ' , ['photo_ids ' => [$ this ->photo4 ->id ], ' from_id ' => $ this -> album4 -> id ]);
7777 $ this ->assertNoContent ($ response ); // 3: viewed photo4
78- $ response = $ this ->postJson ('Metrics::favourite ' , ['photo_ids ' => [$ this ->photo4 ->id ]]);
78+ $ response = $ this ->postJson ('Metrics::favourite ' , ['photo_ids ' => [$ this ->photo4 ->id ], ' from_id ' => $ this -> album4 -> id ]);
7979 $ this ->assertNoContent ($ response ); // 4: favourite photo4
8080 $ response = $ this ->get ('gallery/ ' . $ this ->album4 ->id . '/ ' . $ this ->photo4 ->id );
8181 $ this ->assertOk ($ response ); // 5: shared photo4
Original file line number Diff line number Diff line change 1818use App \Policies \AlbumPolicy ;
1919use App \Rules \AlbumIDListRule ;
2020use App \Rules \RandomIDListRule ;
21+ use App \Rules \RandomIDRule ;
2122use Illuminate \Support \Facades \Gate ;
2223use Illuminate \Validation \Rules \Enum ;
2324use Tests \Unit \Http \Requests \Base \BaseRequestTest ;
@@ -62,6 +63,7 @@ public function testRules(): void
6263 RequestAttribute::ALBUM_IDS_ATTRIBUTE => ['sometimes ' , new AlbumIDListRule ()],
6364 RequestAttribute::PHOTO_IDS_ATTRIBUTE => ['sometimes ' , new RandomIDListRule ()],
6465 RequestAttribute::SIZE_VARIANT_ATTRIBUTE => ['required_if_accepted:photos_ids ' , new Enum (DownloadVariantType::class)],
66+ RequestAttribute::FROM_ID_ATTRIBUTE => ['required_if_accepted:photos_ids ' , new RandomIDRule (true )],
6567 ];
6668 $ this ->assertCount (count ($ expectedRuleMap ), $ rules ); // only validating the first 7 rules & the GRANTS_UPLOAD_ATTRIBUTE is tested afterwards
6769
You can’t perform that action at this time.
0 commit comments