Illinois Gov. James R. Thompson has signed a controversial bill allowing doctors to order AIDS tests for their patients without their knowledge or permission. But the Republican governor vetoed another measure that would have permitted dentists to refuse to treat patients with infectious diseases, such as AIDS. The testing bill was supported by the Illinois State Medical Society, which said it would help doctors treat the disease aggressively. But it was opposed by the Illinois Gay and Lesbian Task Force and a coalition of social service agencies and community groups that called the bill unethical and irresponsible. The new state law effectively repeals a key provision approved last year requiring informed written consent before an HIV antibody test may be administered.