Php 如何在Codeception中使用Stub::update?
我使用Codeception框架编写测试。 我试图在现有存根中使用\Codeception\Stub::update for update方法,但它不起作用Php 如何在Codeception中使用Stub::update?,php,unit-testing,phpunit,codeception,Php,Unit Testing,Phpunit,Codeception,我使用Codeception框架编写测试。 我试图在现有存根中使用\Codeception\Stub::update for update方法,但它不起作用 $this->userServiceStub = Stub::make(User::class, [ 'getService' => function() use ($serviceStub) { return $serviceStub; },
$this->userServiceStub = Stub::make(User::class, [
'getService' => function() use ($serviceStub) {
return $serviceStub;
},
'getFields' => [
'ID' => 1234,
'NAME' => 'First Test User',
],
]);
$this->userServiceStub = Stub::update($this->userServiceStub, [
'getFields' => [
'ID' => 1234,
'NAME' => 'Second Test User',
]
]);
当我使用getFields方法时,我看到了旧名称“FirstTestUser”。如何正确使用Stub::update