get(AcceptGroupInvitationCommandHandler::class); self::assertInstanceOf(AcceptGroupInvitationCommandHandler::class, $handler); $this->expectException(UnprocessableEntityHttpException::class); $group = $this->getGroupRepository()->get(TestReference::GROUP_PRIVATE); $user = $this->getUserRepository()->get(TestReference::ADMIN_LOIC); $message = new AcceptGroupInvitationCommand($group->getId(), $user->getId()); $handler($message); } }