Am I doing something wrong?
<?php
use App\Actions\SomeAction;
test('mock', function () {
mock(SomeAction::class)
->shouldReceive('run')
->once()
->andReturnUndefined();
app(SomeAction::class)->run('foo');
});
<?php
namespace App\Actions;
class SomeAction
{
public function run(string $foo): void
{
throw new \RuntimeException('Unreachable error');
}
}
The run() method should never be executed, or am I wrong?