Our first recommendation would be to circumvent the BMW dealer; visit a STAR smog test & repair center who is familiar with BMWs. The repairs are more than likely going to cost way below the dealers quote. Make no mention of the dealer's repair price. Just pay for a diagnosis; should be 2 hours of labor, and see what repairs they come up with. honestly, $12,000 sounds way to high for smog check repairs, assuming you don't need a new engine, or complete exhaust system (BMW catalytic converters are expensive)... but with 119,000, unless your BMW was running terribly for a long period of time, the CATs should not need replacement. Bottom line, get a second opinion.
Next... if your second opinion turns up the same results, consider applying for the State's Consumer Assistance Program. They will pay up to $500.00 for repairs, and then after that if your BMW still needs repairs to pass (and you can not afford them) you can be issued a one time 2 year smog check waiver from the Bureau of Automotive Repairs.
www.smogtips.com/consumer_assistance.cfm