Testing the photon–photon sector of quantum electrodynamics with free-electron lasers