How to test __get() in Node object?
Yes, magic methods afaik can't be mocked.

You can use get('field_foo')->entity which does exactly the same as __get(), at least in this case. And then make that return a stdClass object with a ->entity property. That's not exactly the same as what really happens, but it will work in the same way for your code.