public function testApplyConverterOnUserCreatesUser() { $id = Uuid::createNew(); $user = new UserReadModel($id, 'user', 'email', 'name', 1); $request = Request::createFromGlobals(); $request->attributes->set('id', $id); $this->userService->expects(self::once())->method('getUser')->with($id)->will(self::returnValue($user)); $this->configuration->expects(self::once())->method('getOptions')->will(self::returnValue(['id' => 'id'])); $this->configuration->expects(self::atLeastOnce())->method('getClass')->will(self::returnValue(UserResource::class)); $this->configuration->expects(self::atLeastOnce())->method('getName')->will(self::returnValue('user')); $converter = new ParamConverter($this->bookService, $this->userService); $converter->apply($request, $this->configuration); self::assertEquals($user->getId()->getValue(), $request->attributes->get('user')->getId()->getValue()); }