1111
1212use OxidEsales \ExamplesModule \Core \Module as ModuleCore ;
1313use OxidEsales \ExamplesModule \Greeting \Controller \Admin \GreetingAdminController ;
14+ use OxidEsales \ExamplesModule \Greeting \Infrastructure \Repository \UserRepositoryInterface ;
1415use OxidEsales \ExamplesModule \Greeting \Model \PersonalGreetingUserInterface ;
15- use OxidEsales \ExamplesModule \Greeting \Service \UserServiceInterface ;
1616use OxidEsales \ExamplesModule \Greeting \Transput \AdminGreetingRequestInterface ;
1717use OxidEsales \ExamplesModule \Tests \Integration \IntegrationTestCase ;
1818use PHPUnit \Framework \Attributes \Test ;
@@ -30,14 +30,14 @@ public function renderSetsTplParamIfEditObjectGivenByRequest(): void
3030 'getPersonalGreeting ' => $ expectedGreeting = uniqid (),
3131 ]);
3232
33- $ userServiceMock = $ this ->createMock (UserServiceInterface ::class);
34- $ userServiceMock ->method ('getUserById ' )
33+ $ userRepositoryMock = $ this ->createMock (UserRepositoryInterface ::class);
34+ $ userRepositoryMock ->method ('getUserById ' )
3535 ->with ($ userId )
3636 ->willReturn ($ userStub );
3737
3838 $ sut = $ this ->getSut (
3939 request: $ requestStub ,
40- userService : $ userServiceMock ,
40+ userRepository : $ userRepositoryMock ,
4141 );
4242
4343 $ this ->assertSame ('@oe_examples_module/admin/user_greetings ' , $ sut ->render ());
@@ -49,11 +49,11 @@ public function renderSetsTplParamIfEditObjectGivenByRequest(): void
4949 #[Test]
5050 public function renderDoesntSetTplParamIfEditObjectIsNotGivenByRequest (): void
5151 {
52- $ userServiceSpy = $ this ->createMock (UserServiceInterface ::class);
53- $ userServiceSpy ->expects ($ this ->never ())->method ('getUserById ' );
52+ $ userRepositorySpy = $ this ->createMock (UserRepositoryInterface ::class);
53+ $ userRepositorySpy ->expects ($ this ->never ())->method ('getUserById ' );
5454
5555 $ sut = $ this ->getSut (
56- userService : $ userServiceSpy ,
56+ userRepository : $ userRepositorySpy ,
5757 );
5858
5959 $ this ->assertSame ('@oe_examples_module/admin/user_greetings ' , $ sut ->render ());
@@ -63,13 +63,13 @@ public function renderDoesntSetTplParamIfEditObjectIsNotGivenByRequest(): void
6363 }
6464
6565 private function getSut (
66- ?UserServiceInterface $ userService = null ,
66+ ?UserRepositoryInterface $ userRepository = null ,
6767 ?AdminGreetingRequestInterface $ request = null
6868 ): GreetingAdminController {
69- $ userService ??= $ this ->createStub (UserServiceInterface ::class);
69+ $ userRepository ??= $ this ->createStub (UserRepositoryInterface ::class);
7070 $ request ??= $ this ->createStub (AdminGreetingRequestInterface::class);
7171 return new GreetingAdminController (
72- userService : $ userService ,
72+ userRepository : $ userRepository ,
7373 request: $ request ,
7474 );
7575 }
0 commit comments