No need to test anything. As claudiupb says, the wrong type of unit can never recieve the wrong kind of promotion from a wonder or building's free promotions. Drill 1 is specific to certain types of units based on their CombatClass specification. The promotion given by a building is also specific and is never altered to a more-fitting promotion based on the unit being created within a city (or in the case of Great Lighthouse, given to all units anywhere on the map that are 'correct' for the Great Lighthouse promotion). Alhambra gives Drill 1 and only Drill 1, and only to the units which are normally able to accept Drill 1. If the unit cannot accept the promotion, then nothing happens. If the unit already has the promotion (like an American Minuteman), they only get the Drill 1 promotion one time, they don't get a second copy of Drill 1.
And so far as the game is concerned a wonder is a building, in case someone wanted to object that I've been talking back and forth about buildings and only sometimes wonders when the discussion is about the Alhambra Wonder.