On a recent trip to Spain, I found a lot of these plants growing on semi-arid scrub environments:
The plant was a spreading, fairly low growing shrub with bipinnate leaves which were deep green and slightly glaucous. Small, sharp spines were hidden in the leaf joints)
It was conspicuously green at a time when most other plants were baked to brown crispy remnants, so maybe it has a deep root system or water storage taproot.
The flowers were about 7cm across, fragrant and opening in the evening, closing early morning.
The fruit was a tough rubbery green ovoid with longitudinal stripes (resembling a small melon), hanging vertically downwards from the stem, I broke one open and it was filled with a mass of small black seeds and whitish, juicy pulp.
The plant has many features that I would expect of a legume, and my initial searches suggested Albizia, but the fruit of that plant is a dry, flat pod.