When using a PHPUnit mock, you can do this:
$mock = $this->createMock(MyClass::class);
$mock->expects(self::once())->method('myMethod');
But method once is not static, you should use $this->once(). Same for other invocation count checker (never, exactly, atLeastOnce, ...)
Add a PHPCS sniffer to check and fix