How can a GFI installed on an ungrounded two-wire line be verified?
You can put a load across the Line Live and the Load Neutral or the Load live and the Line neutral (this is what the test button will do) or between one of the Load conductors and a grounded conductor. This should trip the GFI.

However doing this while the GFI is properly installed is difficult and dangerous because the connections should be hidden and it requires you to poke around a live circuit.

GFIs without a ground are legal but the sockets should be marked with a "no equipment ground" label.