Phase dynamics after connection of two separate Bose-Einstein condensates