Codeception / Codeception/module-doctrine

haveFakeRepository from Doctrine module doesn't work

Đang mở
#20 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
PHP
Star
4
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

#### What are you trying to achieve?
Mock repository with haveFakeRepository method from Doctrine module.

#### What do you get instead?

> Provide console output if related. Use `-vvv` mode for more details.

```bash
[Warning] Repository can't be mocked, the EventManager's repositoryFactory doesn't have "repositoryList" property

```
> Provide test source code if related

```php
$I->haveFakeRepository('App\Entity\User', array('findOneBy' => function ($args) use ($user) {
return $user;
}));
```
### Details

* Codeception version: 2.4.1
* PHP Version: 7.2.4
* Operating System: 16.04.1-Ubuntu
* Installation type: Composer
* List of installed packages (`composer show`)
```bash
doctrine/orm v2.5.13 Object-Relational-Mapper for PHP
symfony/framework-bundle v4.0.8 Symfony FrameworkBundle
```
* Suite configuration:

```yml
actor: ApiTester
modules:
enabled:
- Symfony:
app_path: src
environment: test
params: .env
- REST:
url: /api
depends: Symfony
- Doctrine2:
depends: Symfony
- \Helper\Api```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start at the Doctrine module's haveFakeRepository method and trace the EventManager repositoryFactory handling that produces the missing "repositoryList" warning. Reproduce the issue with the shown Codeception, Doctrine ORM, Symfony, PHP, and suite configuration; done means the App\Entity\User repository can be mocked as shown without the warning.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
php
Lĩnh vực
databases
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.