1

我在我的Laravel 8项目中使用PHP 8构造函数属性提升功能。它工作得很好,但是当您尝试对其进行测试时,覆盖范围不会将构造函数视为已测试

套餐:

  • laravel/框架:^8.12
  • phpunit/phpunit: ^9.5
public function __construct(
        private int $id,
        private string $name
    ) {
    }

    public function getId(): int
    {
        return $this->id;
    }

    public function getName(): string
    {
        return $this->name;
    }

覆盖报告:

覆盖报告

4

0 回答 0