test_mode_off is called by the paypal_test which interacts with the developer. So when the developer will types paypal_test.off, this will call that method and trigger the shutting down of the router and poller.
test_mode_on is not currently called anywhere but it will be triggered by the same idea. When the developer turns runs the paypal test gem, it will be called.