I don't think it's a good idea to test someone's loyalty. Testing someone shows lack of trust which is as a result of something else which might be an old affair, constant absence or a shady behaviour.
Loyalty can't be concealed and there are no tests to find out.(Except you want to give the person a tedious task to undertake to undertake like in the movies).
But i think if your suspecting someone's loyalty come clean to the person and clear your doubts and have peace of mind.
If he/she lies, let thembe the truth will eventually reveal itself.
Firstly, it is important to study the persons attitude/character carefully in order to decipher the kind of person you're dealing with. This will usually give a semblance of such a persons loyalty simply by intuition alone. However, relying on intuition cannot be a trusted enough means of loyalty test.
One of the most effective ways to test loyalty of a person be they friends, employees or coworkers can be through a stress test to determine how much trust and value they have for you.
After you have studied their character, put them in a scenario where their composure, integrity and character will be tested and see how they react. People who react by talking behind your back are likely not loyal.
One of the simpler ones I do for my friends is to confide a harmless secret with them and see if it spreads within each other
See how they treat someone who can't do anything for them.