Heat oil in a skillet over medium heat. Add onion and garlic. Cook and stir until onion is translucent, about 5 minutes. Add green beans, tomatoes, and up to 1/2 cup water. Cook until beans and tomatoes are tender, about 10 minutes. Sprinkle basil, salt, and pepper on top.