test cleanup, replace `define_method` and `remove_method` with stubs.
Merge pull request #10775 from senny/postgres_adapter_test_cleanup

test cleanup, replace `define_method` and `remove_method` with stubs.