Coverage of PHPUnit code in a multi-line parameter list

I have a constructor that looks something like this:

public function __construct(
    PusherManager $pusher,
    ParsePush $parse,
    PusherChannelNameCreator $channelNameCreator,
    ConversationOfferRepositoryInterface $offerRepository,
    ConversationOfferLogRepositoryInterface $offerLogRepository,
    ParseChannelNameCreator $parseChannelNameCreator,
    UserStatusService $userStatusService,
    UserSerializer $userSerializer,
    VisitorSerializer $visitorSerializer
) {
    $this->pusher = $pusher;
    $this->parse = $parse;
    $this->channelNameCreator = $channelNameCreator;
    $this->offerRepository = $offerRepository;
    $this->offerLogRepository = $offerLogRepository;
    $this->parseChannelNameCreator = $parseChannelNameCreator;
    $this->userStatusService = $userStatusService;
    $this->userSerializer = $userSerializer;
    $this->visitorSerializer = $visitorSerializer;
}

When I run PHPUnit code coverage in this file, it marks all lines between __construct(....)as not covered, and this leads to the fact that the percentage of lines covered by the result is incorrect.

Is there any way to overcome this problem?

+4
source share

Source: https://habr.com/ru/post/1620641/


All Articles