Run PhantomJS's tests as part of TravisCI

Related to #11952.
Fixed tests that dealt with manipulating request URLs.

Related to #11952.

Those tests use "http://phantomjs.org" as fixture.
The website "/images" directory has been renamed "/img",
breaking the tests.

Maybe not the greatest way to go about it, but
for now it will do. We probably need to have fixtures
served by a local server.