Testing gravity at cosmological scales