mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Update HttpSocketTest.php
Update tests.
This commit is contained in:
parent
fe774ecc03
commit
bf6c3854e5
1 changed files with 5 additions and 0 deletions
|
@ -255,6 +255,7 @@ class HttpSocketTest extends CakeTestCase {
|
||||||
'port' => 23,
|
'port' => 23,
|
||||||
'timeout' => 30,
|
'timeout' => 30,
|
||||||
'ssl_verify_peer' => true,
|
'ssl_verify_peer' => true,
|
||||||
|
'ssl_allow_self_signed' => false,
|
||||||
'ssl_verify_depth' => 5,
|
'ssl_verify_depth' => 5,
|
||||||
'ssl_verify_host' => true,
|
'ssl_verify_host' => true,
|
||||||
'request' => array(
|
'request' => array(
|
||||||
|
@ -283,6 +284,7 @@ class HttpSocketTest extends CakeTestCase {
|
||||||
'port' => 80,
|
'port' => 80,
|
||||||
'timeout' => 30,
|
'timeout' => 30,
|
||||||
'ssl_verify_peer' => true,
|
'ssl_verify_peer' => true,
|
||||||
|
'ssl_allow_self_signed' => false,
|
||||||
'ssl_verify_depth' => 5,
|
'ssl_verify_depth' => 5,
|
||||||
'ssl_verify_host' => true,
|
'ssl_verify_host' => true,
|
||||||
'request' => array(
|
'request' => array(
|
||||||
|
@ -321,6 +323,7 @@ class HttpSocketTest extends CakeTestCase {
|
||||||
$context = array(
|
$context = array(
|
||||||
'ssl' => array(
|
'ssl' => array(
|
||||||
'verify_peer' => true,
|
'verify_peer' => true,
|
||||||
|
'allow_self_signed' => false,
|
||||||
'verify_depth' => 5,
|
'verify_depth' => 5,
|
||||||
'CN_match' => 'www.cakephp.org',
|
'CN_match' => 'www.cakephp.org',
|
||||||
'cafile' => CAKE . 'Config' . DS . 'cacert.pem'
|
'cafile' => CAKE . 'Config' . DS . 'cacert.pem'
|
||||||
|
@ -1708,9 +1711,11 @@ class HttpSocketTest extends CakeTestCase {
|
||||||
$this->Socket->reset();
|
$this->Socket->reset();
|
||||||
$this->Socket->request('http://example.com');
|
$this->Socket->request('http://example.com');
|
||||||
$this->assertTrue($this->Socket->config['context']['ssl']['verify_peer']);
|
$this->assertTrue($this->Socket->config['context']['ssl']['verify_peer']);
|
||||||
|
$this->assertFalse($this->Socket->config['context']['ssl']['allow_self_signed']);
|
||||||
$this->assertEquals(5, $this->Socket->config['context']['ssl']['verify_depth']);
|
$this->assertEquals(5, $this->Socket->config['context']['ssl']['verify_depth']);
|
||||||
$this->assertEquals('example.com', $this->Socket->config['context']['ssl']['CN_match']);
|
$this->assertEquals('example.com', $this->Socket->config['context']['ssl']['CN_match']);
|
||||||
$this->assertArrayNotHasKey('ssl_verify_peer', $this->Socket->config);
|
$this->assertArrayNotHasKey('ssl_verify_peer', $this->Socket->config);
|
||||||
|
$this->assertArrayNotHasKey('ssl_allow_self_signed', $this->Socket->config);
|
||||||
$this->assertArrayNotHasKey('ssl_verify_host', $this->Socket->config);
|
$this->assertArrayNotHasKey('ssl_verify_host', $this->Socket->config);
|
||||||
$this->assertArrayNotHasKey('ssl_verify_depth', $this->Socket->config);
|
$this->assertArrayNotHasKey('ssl_verify_depth', $this->Socket->config);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue