public function PostTest::sslContextOptionsCallback in reCAPTCHA 6.2
Same name and namespace in other branches
- 7.2 recaptcha-php/tests/ReCaptcha/RequestMethod/PostTest.php \ReCaptcha\RequestMethod\PostTest::sslContextOptionsCallback()
File
- recaptcha-php/
tests/ ReCaptcha/ RequestMethod/ PostTest.php, line 86
Class
Namespace
ReCaptcha\RequestMethodCode
public function sslContextOptionsCallback(array $args) {
$this->runcount++;
$this
->assertCommonOptions($args);
$options = stream_context_get_options($args[2]);
$this
->assertArrayHasKey('http', $options);
$this
->assertArrayHasKey('verify_peer', $options['http']);
$this
->assertTrue($options['http']['verify_peer']);
$key = version_compare(PHP_VERSION, "5.6.0", "<") ? "CN_name" : "peer_name";
$this
->assertArrayHasKey($key, $options['http']);
$this
->assertEquals("www.google.com", $options['http'][$key]);
}