This should do what you want.
$m = \Mockery::mock(ScanEpisode::class, [1])->makePartial();
Edit
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
class ScanEpisode
{
public function __construct(
public int $episode,
){}
public function isOk(): bool
{
$this->episode;
// ...
}
}
public function test_is_ok_method()
{
$m = $this->partialMock(ScanEpisode::class);
// assertions ...
$m->isOk();
}
Hey i'm new at mockey, How can i set argument ($episode) for the ScanEpisode class ? when i do that above it says:
Error : Typed property App\ScanEpisode::$episode must not be accessed before initialization
This should do what you want.
$m = \Mockery::mock(ScanEpisode::class, [1])->makePartial();
Edit
Please or to participate in this conversation.