Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120840254
WellKnownTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
WellKnownTest.php
View Options
<?php
namespace
Tests\Feature\Controller
;
use
App\Utils
;
use
Tests\TestCase
;
class
WellKnownTest
extends
TestCase
{
/**
* Test ./well-known/openid-configuration
*/
public
function
testOpenidConfiguration
():
void
{
$href
=
Utils
::
serviceUrl
(
'/'
);
// HTTP_HOST is not set in tests for some reason, but it's required down the line
$host
=
parse_url
(
$href
,
\PHP_URL_HOST
);
$_SERVER
[
'HTTP_HOST'
]
=
$host
;
$response
=
$this
->
get
(
'.well-known/openid-configuration'
);
$response
->
assertStatus
(
200
)
->
assertJson
([
'issuer'
=>
$href
,
'authorization_endpoint'
=>
$href
.
'/oauth/authorize'
,
'token_endpoint'
=>
$href
.
'/oauth/token'
,
'userinfo_endpoint'
=>
$href
.
'/oauth/userinfo'
,
'grant_types_supported'
=>
[
'authorization_code'
,
'client_credentials'
,
'refresh_token'
,
'password'
,
],
'response_types_supported'
=>
[
'code'
,
],
'id_token_signing_alg_values_supported'
=>
[
'RS256'
,
],
'scopes_supported'
=>
[
'openid'
,
'email'
,
],
]);
}
/**
* Test ./well-known/mta-sts.txt
*/
public
function
testMtaSts
():
void
{
$domain
=
\config
(
'app.domain'
);
$response
=
$this
->
get
(
'.well-known/mta-sts.txt'
);
$response
->
assertStatus
(
200
)
->
assertHeader
(
'Content-Type'
,
'text/plain; charset=UTF-8'
)
->
assertContent
(
"version: STSv1
\n
mode: enforce
\n
mx: {$domain}
\n
max_age: 604800"
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 2:24 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18859873
Default Alt Text
WellKnownTest.php (1 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline