phpunitsymfony1lime-unittest

How to set the userAgent in a functional Test?


I could not find any matching method in sfTestFunctional or sfBrowser to set the UserAgent string. Maybe it's not possible because it goes through php-cli?


Solution

  • $browser->setHttpHeader('User-Agent', 'some custom string')->get('your url') This sets the user agent for the next request, so maybe you want to extend the sfBrowser object to provide the HTTP headers on every request