Fix injector mock for anonymous function