As far as I know, Phantom.JS is headless. The only thing you can do is get the context of the alert with
window.onAlert = function(alertText){
...
}
but no more than this I think. You cannot either close (in general) or render (in Phantom.JS) the alert programmatically.
Some sources:
* Render JavaScript alerts with Phantom.JS
* Close alert programmatically