Codeception / Codeception/AspectMock
Cant mock laravel Model
- Ngôn ngữ chính
- PHP
- Star
- 784
- Fork
- 132
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hi, i use
"codeception/aspect-mock": "^3.0"
"laravel/framework": "5.6.*"
php 7.1.*
Try to do in test
MyModel.php
```
class MyModel extends Model
{
.....
public function someTest()
{
return 'old return';
}
.....
}
```
```
use AspectMock\Test as test;
......
test::double(MyModel::class, [
'someTest' => 'new return',
]);
$m = new MyModel();
var_dump($m->someTest());
......
```
i see 'old return', not what i exept;
config file
```
require __DIR__ . '/autoload.php';
$kernel = \AspectMock\Kernel::getInstance();
$kernel->init([
'debug' => true,
'cacheDir' => app_path() . '/../storage/framework/cache/data',
'includePaths' => [
app_path(),
app_path() . '/../vendor/laravel',
],
'excludePaths' => [
app_path() . '/../test',
]
]);
```
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
Đánh giá
Issue này chưa được đánh giá.