File tree Expand file tree Collapse file tree
src/Subscription/Controller
tests/Unit/Common/Service/Provider Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77use Doctrine \ORM \EntityManagerInterface ;
88use OpenApi \Attributes as OA ;
99use PhpList \Core \Domain \Common \Model \Filter \PaginatedFilter ;
10+ use PhpList \Core \Domain \Messaging \Model \Filter \SubscriberListFilter ;
1011use PhpList \Core \Domain \Subscription \Model \SubscriberList ;
1112use PhpList \Core \Domain \Subscription \Service \Manager \SubscriberListManager ;
1213use PhpList \Core \Security \Authentication ;
@@ -106,14 +107,14 @@ public function __construct(
106107 )]
107108 public function getLists (Request $ request ): JsonResponse
108109 {
109- $ this ->requireAuthentication ($ request );
110+ $ admin = $ this ->requireAuthentication ($ request );
110111
111112 return $ this ->json (
112113 $ this ->paginatedDataProvider ->getPaginatedList (
113114 request: $ request ,
114115 normalizer: $ this ->normalizer ,
115116 className: SubscriberList::class,
116- filter: new PaginatedFilter ( ),
117+ filter: ( new SubscriberListFilter ())-> setOwner ( $ admin ),
117118 ),
118119 Response::HTTP_OK
119120 );
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public function testGetPaginatedListSuccess(): void
3737 $ entityManager ->method ('getRepository ' )->willReturn ($ repository );
3838 $ repository ->expects ($ this ->once ())
3939 ->method ('getFilteredAfterId ' )
40- ->with (0 , 2 );
40+ ->with ($ this -> isInstanceOf (PaginatedFilter::class) );
4141
4242 $ entityManager ->method ('getRepository ' )
4343 ->willReturn ($ repository );
You can’t perform that action at this time.
0 commit comments