An esophageal pH test measures how much, how long, and how often stomach acid enters your esophagus to help diagnose GERD. Before the test, you shouldn't eat after midnight, and you may need to stop ...