OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
3-31-025chanakya
/
assets
/
payment
/
vendor
/
rmccue
/
requests
/
tests
/
Transport
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/26/2025 04:28:23 AM
rwxr-xr-x
📄
BaseTestCase.php
35.96 KB
03/26/2025 04:24:37 AM
rw-r--r--
📄
CurlTest.php
3.74 KB
03/26/2025 04:24:37 AM
rw-r--r--
📄
FsockopenTest.php
2.42 KB
03/26/2025 04:24:37 AM
rw-r--r--
Editing: FsockopenTest.php
Close
<?php namespace WpOrg\Requests\Tests\Transport; use WpOrg\Requests\Exception; use WpOrg\Requests\Hooks; use WpOrg\Requests\Requests; use WpOrg\Requests\Tests\Transport\BaseTestCase; use WpOrg\Requests\Transport\Fsockopen; final class FsockopenTest extends BaseTestCase { protected $transport = Fsockopen::class; public function testBadIP() { $this->expectException(Exception::class); parent::testBadIP(); } public function testExpiredHTTPS() { $this->expectException(Exception::class); $this->expectExceptionMessage('SSL certificate did not match the requested domain name'); parent::testExpiredHTTPS(); } public function testRevokedHTTPS() { $this->expectException(Exception::class); $this->expectExceptionMessage('SSL certificate did not match the requested domain name'); parent::testRevokedHTTPS(); } /** * Test that SSL fails with a bad certificate */ public function testBadDomain() { $this->expectException(Exception::class); $this->expectExceptionMessage('SSL certificate did not match the requested domain name'); parent::testBadDomain(); } /** * Issue #248. */ public function testContentLengthHeader() { $hooks = new Hooks(); $hooks->register('fsockopen.after_headers', [$this, 'checkContentLengthHeader']); Requests::post($this->httpbin('/post'), [], [], $this->getOptions(['hooks' => $hooks])); } /** * Issue #248. */ public function checkContentLengthHeader($headers) { $this->assertStringContainsString('Content-Length: 0', $headers); } /** * Issue #335/#339. */ public function testHTTPVersionHeader() { // Remember the original locale. $locale = setlocale(LC_NUMERIC, 0); // Set the locale to one using commas for the decimal point. setlocale(LC_NUMERIC, 'de_DE@euro', 'de_DE.utf8', 'de_DE', 'de', 'ge'); // Make sure the locale was changed. $this->assertNotSame($locale, setlocale(LC_NUMERIC, 0), 'Changing the locale failed'); $hooks = new Hooks(); $hooks->register('fsockopen.after_headers', [$this, 'checkHTTPVersionHeader']); Requests::post($this->httpbin('/post'), [], [], $this->getOptions(['hooks' => $hooks])); // Reset the locale. setlocale(LC_NUMERIC, $locale); } /** * Issue #335/#339. */ public function checkHTTPVersionHeader($headers) { $this->assertStringContainsString('HTTP/1.1', $headers, 'HTTP header is influenced by the system locale'); } }