PHPUnit代码覆盖多行参数列表

时间:2015-12-17 22:02:12

标签: php unit-testing laravel phpunit

我有一个看起来像这样的构造函数:

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(....)之间的所有行标记为未覆盖,并且会导致覆盖的行的百分比结果错误。

有没有办法克服这个问题?

0 个答案:

没有答案