phpunit-selenium icon indicating copy to clipboard operation
phpunit-selenium copied to clipboard

Can't test against snakeoil website

Open openbrian opened this issue 10 years ago • 5 comments

It would be nice if the user could set a context for the file_get_contents() call in RemoteCoverage.php. This way they could create a context that sets verify_peer and verify_peer_name to false. This error is silently ignored due to @.

openbrian avatar Nov 10 '15 21:11 openbrian

Agreed. This is an issue with quite a number of vendor SDKs that I use, especially since php-5.6

robgudgeon avatar Nov 10 '15 23:11 robgudgeon

The way I would solve this in general is to use a HTTP request library, but here we are trying to keep dependencies to a minimum so the proposed solution. I will merge a Pull Request adding this support, the test Tests_Selenium2TestCase_Coverage_RemoteCoverageTest should be extended to deal with this feature.

giorgiosironi avatar Nov 21 '15 09:11 giorgiosironi

Would you prefer a implicit stream context (http://php.net/manual/en/function.stream-context-set-default.php) or an explicit one like this file_get_contents($url, false, $streamContext) ?

openbrian avatar Dec 08 '15 15:12 openbrian

The first one implies global state so the second is better imho.

giorgiosironi avatar Dec 08 '15 19:12 giorgiosironi

See #360.

openbrian avatar Dec 09 '15 14:12 openbrian