OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
3-31-025chanakya
/
assets
/
payment
/
vendor
/
rmccue
/
requests
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/26/2025 04:24:36 AM
rwxr-xr-x
📁
Auth
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
AutoloadTest.php
1.78 KB
03/26/2025 04:23:17 AM
rw-r--r--
📁
Cookie
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
CookieTest.php
24.35 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
EnvironmentTest.php
929 bytes
03/26/2025 04:23:17 AM
rw-r--r--
📁
Exception
-
03/26/2025 04:28:23 AM
rwxr-xr-x
📁
Fixtures
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
HooksTest.php
12.29 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
IdnaEncoderTest.php
9.93 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
Ipv6Test.php
3.47 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
IriTest.php
15.86 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
PortTest.php
2.37 KB
03/26/2025 04:23:17 AM
rw-r--r--
📁
Proxy
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📁
Requests
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
RequestsTest.php
12.88 KB
03/26/2025 04:23:17 AM
rw-r--r--
📁
Response
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
ResponseTest.php
1.72 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
SessionTest.php
12.91 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
SslTest.php
16.13 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
TestCase.php
1.48 KB
03/26/2025 04:23:17 AM
rw-r--r--
📁
Transport
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📁
Utility
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
bootstrap.php
2.84 KB
03/26/2025 04:23:17 AM
rw-r--r--
📁
utils
-
03/26/2025 04:28:23 AM
rwxr-xr-x
Editing: PortTest.php
Close
<?php namespace WpOrg\Requests\Tests; use WpOrg\Requests\Exception; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Port; use WpOrg\Requests\Tests\TestCase; /** * @covers \WpOrg\Requests\Port::get */ final class PortTest extends TestCase { /** * Test retrieving a port based on a passed input value. * * @dataProvider dataGetPort * * @param mixed $input Input to pass to the function. * @param int $expected Expected function return value. * * @return void */ public function testGetPort($input, $expected) { $this->assertSame($expected, Port::get($input)); } /** * Data provider. * * @return array */ public function dataGetPort() { return [ 'lowercase type' => [ 'input' => 'https', 'expected' => Port::HTTPS, ], 'mixed type' => [ 'input' => 'Dict', 'expected' => Port::DICT, ], 'uppercase type' => [ 'input' => 'ACAP', 'expected' => Port::ACAP, ], ]; } /** * Test that when a $type parameter of an incorrect type gets passed, an exception gets thrown. * * @dataProvider dataGetPortThrowsExceptionOnInvalidInputType * * @param mixed $input Input to pass to the function. * * @return void */ public function testGetPortThrowsExceptionOnInvalidInputType($input) { $this->expectException(InvalidArgument::class); $this->expectExceptionMessage('Argument #1 ($type) must be of type string'); Port::get($input); } /** * Data provider. * * @return array */ public function dataGetPortThrowsExceptionOnInvalidInputType() { return [ 'null' => [null], 'integer port number' => [443], ]; } /** * Test that when an unsupported port type is requested, an exception gets thrown. * * @dataProvider dataGetPortThrowsExceptionOnUnsupportedPortType * * @param string $input Input to pass to the function. * * @return void */ public function testGetPortThrowsExceptionOnUnsupportedPortType($input) { $this->expectException(Exception::class); $this->expectExceptionMessage('Invalid port type'); Port::get($input); } /** * Data provider. * * @return array */ public function dataGetPortThrowsExceptionOnUnsupportedPortType() { return [ 'type not supported' => ['FTP'], 'empty string' => [''], ]; } }