Immigration bill survives early tests as senators defeat GOP amendments on border security