Rinse mushrooms well, then soak in warm water for one hour. Drain, pat dry and chop coarsely.
Cut onion into slices 1/8-inch thick. Melt butter over medium heat, then add onions and reduce to medium-low. Cook, stirring and turning occasionally, until deep brown, about 30 minutes.
Bring 4 quarts water to a boil and cook beans for 5 minutes.
While beans are cooking, add garlic and porcini to onions. Cook an additional 2 to 3 minutes, until porcini are warmed through. Add salt and pepper to taste and cover to keep warm while beans finish cooking.
Drain beans well, mix in mushrooms and onions and serve.