Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我找不到任何匹配的方法sfTestFunctional或sfBrowser设置 UserAgent 字符串。也许这是不可能的,因为它通过 php-cli?
sfTestFunctional
sfBrowser
$browser->setHttpHeader('User-Agent', 'some custom string')->get('your url') 这会为下一个请求设置用户代理,因此您可能希望扩展 sfBrowser 对象以在每个请求上提供 HTTP 标头
$browser->setHttpHeader('User-Agent', 'some custom string')->get('your url')