The other answers state the facts, but here is (I hope) a bit more explanation:
A ground fault that a GFCI interrupts, does not necessarily have to do with ground per se. A GFCI watches hot and neutral to make sure they have the same amount of current. Any imbalance means some current is going someplace it shouldn't go. That can include:
- Ground wire
- Through a person to physical ground
- Directly to physical ground - e.g., metal case on a wet floor
A GFCI tester takes some current from Hot and sends it to the Ground wire. Sending it through a person deliberately is never a good idea, and it is hand-held so it isn't touching ground, so the Ground wire is the only thing left. This is done through an appropriately sized load (probably just a simple resistor) so that the current involved is large enough to trip the GFCI but small enough to be relatively safe and most definitely small enough that it won't trip a regular breaker. Stick a plain wire into Hot and Ground and you will trip GFCI, but you'll also trip the regular breaker (hard to say which would go first) and possibly hurt yourself and start a fire, so don't try that
But if the ground pin is not connected then the GFCI tester tries to send current from Hot to Ground but it never gets anywhere - essentially the same as having a hot wire sit open in the air. The GFCI doesn't trip, but no harm is done, and it does not in any indicate that there is a problem with the GFCI.
Normally, a 3-wire receptacle can't be installed without the ground pin properly connected to a ground. However, an exception is allowed if and only if there is a GFCI upstream. The reasoning is that the very same type of safety problems that a ground wire protects - a short-circuit routing power from hot to ground - will also be protected by a GFCI when it spots the current mismatch. In this setup, if the power doesn't go anywhere, such as a short from hot to a metal appliance cabinet, the GFCI won't initially trip. But as soon as someone touches it and some of the current starts to go into the person, the GFCI will detect the imbalance and trip, providing comparable safety (actually often much better) to what a traditional ground wire would provide.
The one exception is static electricity, electrical noise and other uses of the ground wire. These will not be protected in this setup because the ground wire doesn't actually go to the ground. Not much of a safety problem, but it can be a potential sensitive equipment damage problem. As a result, these ungrounded 3-pin receptacles are supposed to be labeled to indicate that they are GFCI protected but not grounded.