我有一个看起来像这样的构造函数:
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;
}
当我在此文件上运行PHPUnit代码覆盖时,它会将__construct(....)
之间的所有行标记为未覆盖,并且会导致覆盖的行的百分比结果错误。
有没有办法克服这个问题?