Pass proper variable to test_discount_is_valid_when_purchasing(). #2302
Better defensive coding in edd_get_discount_by(). #2302