symfony / panther

A browser testing and web crawling library for PHP and Symfony
MIT License
2.93k stars 219 forks source link

[Question] - Using custom domain name #278

Open pmontoya opened 4 years ago

pmontoya commented 4 years ago

Hello,

I try to use panther for my functional tests. My symfony routing use host prefix (admin is hosted on admin.my-dev-domain.wip, front on www.my-dev-domain.wip) and I use symfony cli as web server in dev env. I don't know how to test it with panther. If I set external_base_uri parameter, I don't know how to use the symfony cli proxy to use the domain and I've got a 404 blank page. If I don't set the parameter, my URI doesn't match the route as the URI is 127.0.0.1:9080.

Anyone has a solution for my problem ?

Thanks to all the community!

apatkinson commented 3 years ago

Should be able to solve with:

$client = self::createPantherClient(['hostname' => 'sub-domain.localhost']);
$client->request('GET', '/');