vitorjustin wrote a reply+100 XP
5mos ago
vitorjustin liked a comment+100 XP
5mos ago
I came across this problem recently and i have found the solution in mockery DOC not calling the Original constructor you can use this code if you like
public function PartialMockWithRunningConstructor(string $abstract, array|string $trackedMethods)
{
if (is_string($trackedMethods))
$trackedMethods = Arr::wrap($trackedMethods);
$mock = Mockery::mock($abstract . '[' . implode(',', $trackedMethods) . ']');
$this->instance($abstract, $mock);
return $mock;
}