Narrow the return types to API types in tests.

This should drastically reduce the number of internal “hits” in plugins.
:+1: