Definition at line 22 of file HttpPathBuilderTest.php.
◆ environmentProvider()
static HttpPathBuilderTest::environmentProvider |
( |
| ) |
|
|
static |
- Returns
- Generator<string, array{ server_data: array<string, mixed>|ArrayAccess<string, mixed>, http_path: string, wsdl_path: string, allowed_hosts: string }>
Definition at line 32 of file HttpPathBuilderTest.php.
34 yield
'Host matches configured HTTP path (no `allowed_hosts` configuration)' => [
36 'HTTP_HOST' =>
'localhost',
37 'REQUEST_URI' =>
'/login.php',
39 'http_path' =>
'http://localhost',
40 'wsdl_path' =>
'https://localhost/soap/server.php?wsdl=1',
41 'allowed_hosts' =>
'',
44 yield
'Host matches configured WSDL path (no `allowed_hosts` configuration)' => [
46 'HTTP_HOST' =>
'soap.ilias.de',
47 'REQUEST_URI' =>
'/login.php',
49 'http_path' =>
'https://test.ilias.de',
50 'wsdl_path' =>
'https://soap.ilias.de/soap/server.php?wsdl=1',
51 'allowed_hosts' =>
'',
54 yield
'Localhost is always allowed (no `allowed_hosts` configuration)' => [
56 'HTTP_HOST' =>
'localhost',
57 'REQUEST_URI' =>
'/login.php',
59 'http_path' =>
'https://test.ilias.de',
60 'wsdl_path' =>
'https://test.ilias.de/soap/server.php?wsdl=1',
61 'allowed_hosts' =>
'',
64 yield
'Host is in `allowed_hosts` list' => [
66 'HTTP_HOST' =>
'test2.ilias.de',
67 'REQUEST_URI' =>
'/login.php',
69 'http_path' =>
'https://test.ilias.de',
70 'wsdl_path' =>
'https://test.ilias.de/soap/server.php?wsdl=1',
71 'allowed_hosts' =>
'test2.ilias.de',
◆ getHttpsMock()
HttpPathBuilderTest::getHttpsMock |
( |
| ) |
|
|
private |
◆ getIniMock()
HttpPathBuilderTest::getIniMock |
( |
string |
$http_path | ) |
|
|
private |
◆ getSettingsMock()
HttpPathBuilderTest::getSettingsMock |
( |
string |
$wsdl_path, |
|
|
string |
$allowed_hosts |
|
) |
| |
|
private |
Definition at line 114 of file HttpPathBuilderTest.php.
References null.
Referenced by testUnknownHostWillRaiseException(), and testValidHostsTriggerNoExceptions().
117 :
ilSetting&\PHPUnit\Framework\MockObject\MockObject {
119 ->getMockBuilder(ilSetting::class)
120 ->disableOriginalConstructor()
121 ->onlyMethods([
'get'])
123 $settings->method(
'get')->willReturnCallback(
124 static fn(
string $key, ?
string $default =
null): ?
string => match ($key) {
125 'soap_wsdl_path' => $wsdl_path,
126 'allowed_hosts' => $allowed_hosts,
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testUnknownHostWillRaiseException()
HttpPathBuilderTest::testUnknownHostWillRaiseException |
( |
| ) |
|
Definition at line 96 of file HttpPathBuilderTest.php.
References getHttpsMock(), getIniMock(), and getSettingsMock().
98 $this->expectException(RuntimeException::class);
100 $path_builder = new \ILIAS\Init\Environment\HttpPathBuilder(
102 $this->
getSettingsMock(
'https://test.ilias.de/soap/server.php?wsdl=1',
'test.ilias.de'),
106 'HTTP_HOST' =>
'phishing.ilias.de',
107 'REQUEST_URI' =>
'/login.php',
111 $path_builder->build();
getSettingsMock(string $wsdl_path, string $allowed_hosts)
Interface Observer Contains several chained tasks and infos about them.
getIniMock(string $http_path)
◆ testValidHostsTriggerNoExceptions()
HttpPathBuilderTest::testValidHostsTriggerNoExceptions |
( |
array|ArrayAccess |
$server_data, |
|
|
string |
$http_path, |
|
|
string |
$wsdl_path, |
|
|
string |
$allowed_hosts |
|
) |
| |
environmentProvider
- Parameters
-
array<string,mixed>|ArrayAccess<string,mixed> | $server_data |
Definition at line 79 of file HttpPathBuilderTest.php.
References getHttpsMock(), getIniMock(), and getSettingsMock().
85 $path_builder = new \ILIAS\Init\Environment\HttpPathBuilder(
93 $this->assertNotEmpty((
string) $path_builder->build());
getSettingsMock(string $wsdl_path, string $allowed_hosts)
Interface Observer Contains several chained tasks and infos about them.
getIniMock(string $http_path)
The documentation for this class was generated from the following file: