Ben alay ile phpunit (DB/fikstür olmadan) çalıştırıyorum, ama bir model alay ile ilgili bir sorunum var. Denedim SonraYii2 Mockery ile ActiveRecord ile alay etme
BadMethodCallException: Method Mockery_1_models_Customer::hasAttribute() does not exist on this mock object
:
$customer->shouldReceive('hasAttribute')->andReturn(true);
Ama yine, ben de çalıştırın:
$customer = Mockery::mock(CustomerModel::class);
echo $customer->id;
hata üretir
Fatal error: Call to a member function getDb() on a non-object in ..\yiisoft\yii2\db\ActiveRecord.php on line 135
Herhangi bir öneriniz var mı?
Teşekkürler, deneyeceğim! –