the above is correct, even though it's called a "safety" inspection, a visual inspection of all the emissions equipment is still technically required. whether or not that actually happens is another story. usually, it's just a quick glance at things, if that. whether through ignorance or lack of care, the large majority of places will let you slide on minor/inconspicuous things (gutted cat, blocked off egr with a valve body still in place, etc.). it usually takes a glaring violation to fail the visual. however, there are plenty of inspectors out there that will ignore anything, especially if a tip is involved.
very hard to believe it passed emissions under the current test procedures with the cel on, i'd be curious to know how. i guess it's possible somebody somewhere has figured something out by now, but as far as i know there is absolutely no way to get an obdII emissions test through the computer as passed with the cel on and/or the appropriate systems not showing as "ready".
of course, it's possible to cover things up through custom aftermarket tuning of a vehicles computer, but the end result of that is to create the illusion to the inspection software that everything is normal, i.e. no cel on, all systems showing ready, etc. i'm not aware of any possible way to fool the inspection computer/dmv system into a pass if the cel is on, there are codes set, too many systems "not ready", or whatever else. gone are the days of simply pulling the bulb to the cel, sticking the tailpipe sniffer in another vehicle, etc.