Add small unittest for Purchase::getPurchasesForUser